a, b = map(int, input().split())
arr = []
for i in range(1, b+1):
for j in range(1, i+1):
arr.append(i)
if (len(arr) >= b):
break
print(sum(arr[a-1:b]))
a, b = map(int, input().split())
arr = []
for i in range(1, b):
arr = arr + ([i] * i)
if (len(arr) >= b):
break
print(sum(arr[a-1:b]))