a, b = (int(i) for i in input().split())

print((sum(range(b-a))-a))
a, b = (int(i) for i in input().split())

c = b - a

d = c*(c+1)//2

print((d - b))

a, b = (int(i) for i in input().split())
print((sum(range(b - a)) - a))

a, b = (int(i) for i in input().split())
c = b - a
d = c * (c + 1) // 2
print((d - b))

-print((sum(range(b - a)) - a)) +c = b - a +d = c * (c + 1) // 2 +print((d - b))