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

towers = [0] * 1000

for i in range(999):

	towers[i + 1] = towers[i] + 1 + i

diffs = [0] * 1000

for i in reversed(list(range(999))):

	diffs[i] = towers[i + 1] - towers[i]

target_idx = diffs.index(b - a)

print(towers[target_idx] - a)





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



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

a, b = list(map(int, input().split()))
towers = [0] * 1000
for i in range(999):
    towers[i + 1] = towers[i] + 1 + i
diffs = [0] * 1000
for i in reversed(list(range(999))):
    diffs[i] = towers[i + 1] - towers[i]
target_idx = diffs.index(b - a)
print(towers[target_idx] - a)

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

-towers = [0] * 1000 -for i in range(999): -    towers[i + 1] = towers[i] + 1 + i -diffs = [0] * 1000 -for i in reversed(list(range(999))): -    diffs[i] = towers[i + 1] - towers[i] -target_idx = diffs.index(b - a) -print(towers[target_idx] - a) +print((b - a) * (b - a + 1) / 2 - b)