a,b = list(map(int, input().split()))



diff = b-a

H = diff*(diff-1)//2

print((H-a))

a,b = list(map(int, input().split()))

n = b-a

print((n*(n+1)//2-b))

a, b = list(map(int, input().split()))
diff = b - a
H = diff * (diff - 1) // 2
print((H - a))

a, b = list(map(int, input().split()))
n = b - a
print((n * (n + 1) // 2 - b))

-diff = b - a -H = diff * (diff - 1) // 2 -print((H - a)) +n = b - a +print((n * (n + 1) // 2 - b))