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

out = 0

for i in range(b-a):

    out += i+1

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

num = b - a

print((((1+num)*num)//2 - b))
a, b = list(map(int, input().split()))
out = 0
for i in range(b - a):
    out += i + 1
print((out - b))

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

-out = 0 -for i in range(b - a): -    out += i + 1 -print((out - b)) +num = b - a +print((((1 + num) * num) // 2 - b))