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



c = b - a



count = 0

for i in range(c+1):

    count += i

count -= b



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



n = b - a

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

a, b = list(map(int, input().split()))
c = b - a
count = 0
for i in range(c + 1):
    count += i
count -= b
print(count)

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

-c = b - a -count = 0 -for i in range(c + 1): -    count += i -count -= b -print(count) +n = b - a +print((((n + 1) * n) // 2 - b))