Problem:
 Score : 200 points    Problem Statement In some village, there are 999 towers that are 1,(1+2),(1+2+3),...,(1+2+3+...+999) meters high from west to east, at intervals of 1 meter.  It had been snowing for a while before it finally stopped. For some two adjacent towers located 1 meter apart, we measured the lengths of the parts of those towers that are not covered with snow, and the results are a meters for the west tower, and b meters for the east tower.  Assuming that the depth of snow cover and the altitude are the same everywhere in the village, find the amount of the snow cover.  Assume also that the depth of the snow cover is always at least 1 meter.      Constraints  1 \leq a < b < 499500(=1+2+3+...+999)  All values in input are integers.  There is no input that contradicts the assumption.         Input Input is given from Standard Input in the following format:  a  b       Output If the depth of the snow cover is x meters, print x as an integer.        Sample Input 1 8 13      Sample Output 1 2  The heights of the two towers are 10 meters and 15 meters, respectively.
Thus, we can see that the depth of the snow cover is 2 meters.       Sample Input 2 54 65      Sample Output 2 1

Solution (Python):
a, b = map(int, input().split())

t = b - a

total = 0
for i in range(1,t+1):
    total += i
    
print(total - b)

Solution (Python):
a,b=map(int,input().split())
h=sum([i for i in range(1,b-a+1)])
print(h-b)

Solution (Python):
a , b = map(int, input().split())

d = b - a
s = 0
for i in range(1,d):
  s += i
  
print(s-a)

Solution (Python):
a,b = map(int,input().split())
ans = 0
N = b - a
for i in range(1,N):
  ans += i
print(ans - a)

Solution (Python):
a, b = map(int, input().split())
d = b - a - 1
print(d*(d+1)//2 - a)

Solution (Python):
a,b=map(int,input().split())
d=b-a

def A(n):
  hoge = int(n*(((n-1)/2)+1))
  return hoge

B=A(d)
print(B-b)

Solution (Python):
a,b=map(int,input().split())

heightl=[]
height=0
for i in range(1,1000):
    height+=i
    heightl.append(height)

for i in range(1000):
    cur=heightl[i]
    nex=heightl[i+1]
    if cur>a:
        if nex-b==cur-a:
            ans=cur-a
            break
print(ans)

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

Solution (Python):
a, b = [int(i) for i in input().split()]

y = b - a

ans = sum(list(range(1, y))) - a
print(ans)

Solution (Python):
a, b = map(int, input().split())
print(((b-a-1)*(b-a))//2-a)

Solution (Python):
a, b = map(int, input().split())
temp = 0
bar_heights = []
for i in range(1, 1000):
    temp += i
    bar_heights.append(temp)

for i in range(1, 499501):
    if (a + i) in bar_heights and \
       (b + i) == bar_heights[bar_heights.index(a + i) + 1]:
        print(i)
        break

Solution (Python):
a,b=map(int,input().split())
check=0
for i in range(1,(b-a)+1):
  check+=i
print(check-b)

Solution (Python):
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

a,b=map(int,input().split())
sa=b-a
print(sum(range(1,sa))-a)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()


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

Solution (Python):
a, b = map(int, input().split())

res = 0
for i in range(b-a):
    res += i
print(res - a)

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

Solution (Python):
A,B=map(int,input().split())
N=B-A
X=N*(N+1)//2
print(X-B)

Solution (Python):
if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    diff = a[1]-a[0]
    count =0
    for i in range(diff):
        count+=i

    print(count-a[0])

Solution (Python):
a,b=map(int,input().split())
n=b-a

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

Solution (Python):
a, b = map(int,input().split())
ta = 0
for i in range(b-a):
  ta += i
print(ta - a)

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

Solution (Python):
a, b = map(int, input().split())
t = 0
for i in range(b-a):
    t += i
print(t-a)

Solution (Python):
a,b = map(int,input().split())

d = b - a
x = [1]
for i in range(1,1000):
  x.append(i+1+x[i-1])
  if x[i] - x[i-1] == d:
    break
    
print(x[-1] - b)

Solution (Python):
import bisect

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

towers = []
last = 0
for i in range(1, 1000):
    towers.append(last+i)
    last += i

diff = b - a

print(towers[diff-1] - b)

Solution (Python):
A, B = map(int, input().split())
print((B - A) * (B - A + 1) // 2 - B)

Solution (Python):
a, b = (int(i) for i in input().split())
ans = (b-a-1)*(b-a)/2 - a
print(int(ans))

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 9)

a,b = map(int,input().split())
d = b-a

def h(x:int):
    if x == 1:
        return 1
    else:
        return h(x-1)+x

print (h(d)-b)

Solution (Python):
A, B = map(int, input().split())
 
diff = B - A
height_A = diff * (diff - 1) // 2
 
ans = height_A - A
 
print(ans)

Solution (Python):
a,b = map(int,input().split())
n = b-a

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

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

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

Solution (Python):
a, b = map(int, input().split())
print((b - a) * (b - a - 1) // 2 - a)

Solution (Python):
A, B = map(int, input().split())

diff = B - A
height_A = diff * (diff - 1) // 2

ans = height_A - A

print(ans)

Solution (Python):
def resolve():
    a, b = map(int, input().split())
    ans = 0
    for i in range(b-a):
        ans += i+1
    print(ans-b)
resolve()

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

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

Solution (Python):
a,b=map(int,input().split())
x=b-a
c=(1+x)*x//2
print(c-b)

Solution (Python):
a,b=map(int,input().split())
k=b-a
n=k*(k+1)//2
s=n-b
print(s)

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

Solution (Python):
a,b = map(int,input().split())
n = b-a
h = n*(n+1)//2
snow = h-b
print(snow)

Solution (Python):
a,b = map(int,input().split())
n = b-a - 1
h = n*(n+1)//2
snow = h-a
print(snow)

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

Solution (Python):

import sys
input = sys.stdin.readline









A,B = map(int,input().split())

d = B-A
H = d*(d+1)//2
print(H-B)

Solution (Python):
a,b = map(int,input().split())
li = []
for i in range(1,1000):
    li.append(i*(i+1)//2)
difference = b-a
print(li[difference - 2] - a)

Solution (Python):
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

a,b = nm()

s = 0

for i in range(1000):

  if b-a == i:
    print(s-a)
    break

  s+=i

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

A, B = lr()
diff = B - A
x = diff - 1
answer = x * (x+1) // 2 - A
print(answer)

Solution (Python):
a,b = map(int,input().split())
x = abs(b-a)
sum = 0
for i in range(x):
    sum += i+1
print(sum-b)

Solution (Python):
a, b = map(int, input().split())
diff = b - a
print((1 + diff) * diff // 2 - b)

Solution (Python):
a, b = map(int, input().split())
nb = b - a
lb = nb*(nb + 1)//2
print(lb - b)

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

Solution (Python):
a, b = map(int, input().split())
ans = (b - a) * (b - a - 1) / 2 - a
print(int(ans))

Solution (Python):
a, b = map(int, input().split())
c = b - a
t = [1]
for i in range(1100):
    t.append(t[i]+i+2)
idx = 0
for i in range(1000):
    if t[i+1] - t[i] == c:
        idx = i + 1
        break

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

Solution (Python):
a,b=map(int,input().split())
temp=b-a
k=0
for i in range(temp):
  k=k+i
print(k-a)

Solution (Python):
a, b = map(int, input().split())

sum = 0
for i in range(b-a):
    sum += i

print(sum - a)

Solution (Python):
a, b = map(int, input().split())
n = b-a-1
num = 0
for i in range(1,n+1):
    num += i

print(num-a)

Solution (Python):
a, b = map(int, input().split())

High = [1]
for i in range(998):
    High.append(High[-1] + i+2)

A = []
for h1, h2 in zip(High, High[1:]):
    A.append(h2 - h1)
    if h2 - h1 == b - a:
        print(h1-a)
        exit()

Solution (Python):
a, b = map(int,input().split())
ans = 0
for i in range(b-a+1):
    ans += i 
print(ans-b)

Solution (Python):
v = []
sums = 1
for i in range(2,1010):
    v.append(sums)
    sums += i
a,b = map(int,input().split())
for i in range(1000):
    if v[i] - a == v[i+1] - b:
        print(v[i] - a)
        break

Solution (Python):
a,b = map(int,input().split())
x = b-a
y = 0
for i in range(x):
    y += i+1
print(y-b)

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

Solution (Python):
a, b = map(int, input().split())
x = b - a
east = 0
for i in range(1, x+1):
    east += i

ans = east - b
print(ans)

Solution (Python):
from sys import stdin
input = stdin.readline

def VI(N, init=0):
  return [init for _ in range(N)]
def VVI(N, M, init=0):
  return [[init for _ in range(M)] for _ in range(N)]

def VD(N, init=0.0):
  return [init for _ in range(N)]
def VVD(N, M, init=0.0):
  return [[init for _ in range(M)] for _ in range(N)]

def Decimal(x):
  print("{0:.10f}".format(x))

class Pair:
  def __init__(self, x=0, y=0):
    self.first = x
    self.second = y

  def __repr__(self):
    return '{0} {1}'.format(self.first, self.second)

  def __lt__(self, pi):
    return self.first < pi.second

def POW(x, n):
  ret = 1
  while n:
    if n&1:
      ret *= x
    x *= x
    n >>= 1
  return ret

towers = [0 for _ in range(999)]
towers[0] = 1

for i in range(1, 999):
  towers[i] = towers[i-1] + (i+1)

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

ans = -1
for i in range(998):
  if towers[i] - a == towers[i+1] - b:
    ans = towers[i]-a
    if ans >= 0:
      break

print(ans)

Solution (Python):
a,b = map(int,input().split())

temp = 0
dif = b - a

for i in range(1,1000):
    temp += i
    if i == dif:
        ans = temp - b
        print(ans)
        exit(0)

Solution (Python):
a,b = map(int, input().split())
summ = 0

for i in range(1,b-a+1):
  summ=summ+i
print(summ-b)

Solution (Python):


import sys






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    a, b = mi()
    diff = b - a
    print(diff * (diff+1) // 2 - b)


if __name__ == "__main__":
    main()

Solution (Python):
a, b = map(int, input().split())
x = b - a
tmp = 0
for i in range(1, x):
    tmp += i
print(tmp - a)

Solution (Python):
a,b=map(int,input().split())

n=b-a
ans=n*(n-1)//2-a

print(ans)

Solution (Python):
a,b=map(int,input().split())

n=b-a
ans=n*(n-1)//2 -a

print(ans)

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(1,b-a):
    ans+=i
print(ans-a)

Solution (Python):
a, b = map(int, input().split())
d = b - a
r = (d * (d + 1)) // 2
print(r - b)

Solution (Python):
a, b = map(int, input().split())
c = b-a
print((c*(c+1)//2)-b)

Solution (Python):
a,b=map(int,input().split())
s=0
for i in range(b-a):
    s+=i
print(s-a)

Solution (Python):

import sys


def solve(a: int, b: int):
    c = b - a
    high = (c + 1) * c / 2
    print(int(high - b))
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  
    b = int(next(tokens))  
    solve(a, b)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy
a, b = map(int, input().split())

d = b - a
print(d * (d - 1) // 2 - a)

Solution (Python):
def resolve():
    a, b = map(int, input().split())
    n = b - a
    print(n*(n-1)//2 - a)
resolve()

Solution (Python):
a,b=map(int,input().split())
ans=0
for i in range(1,b-a) :
    ans+=i
print(ans-a)

Solution (Python):
a,b = map(int,input().split())
m = b-a
print(m*(m+1)//2-b)

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def Yes(): print("Yes"); return
def No(): print("No"); return


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def Base_10_to_n(X, n):
  if (int(X/n)):
    return Base_10_to_n(int(X/n), n)+[X%n]
  return [X%n]






a,b = inputIL()

d = b-a

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

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

Solution (Python):
a,b=map(int,input().split())
n=abs(b-a)
val=int(n*(n+1)/2)
print(val-b)

Solution (Python):
a,b=[int(x) for x in input().split()]
temp=b-a
print(temp*(temp+1)//2-b)

Solution (Python):
a,b=map(int,input().split())
x=[i*(i+1)//2 for i in range(1,1000)]
for i in range(999):
    if a<x[i] and x[i]-a==x[i+1]-b:
        print(x[i]-a)
        break

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

Solution (Python):
a, b = map(int, input().split())
x = [i  *(i + 1) // 2 for i in range(1, 1000)]
for i in range(999):
    if a <  x[i] and x[i] - a == x[i+1] - b:
        print(x[i] - a)
        break

Solution (Python):
a, b = list(map(int, input().split()))
print(sum([i for i in range(1, b - a + 1)] + [-b, ]))

Solution (Python):
a,b=map(int,input().split())
d=b-a
tree=[]
tr=0
for i in range(1,1000):
    tr+=i
    tree.append(tr)


print(tree[d-1]-b)

Solution (Python):
a, b = map(int, input().split())

h_gnd = -b
for i in range(b - a):
  h_gnd += b - a - i
  
print(h_gnd)

Solution (Python):
a,b = map(int,input().split())
i = b-a
print(i*(i+1)//2-b)

Solution (Python):
a, b = [int(x) for x in input().split()]
temp = b - a
print(temp * (temp + 1) // 2 - b)

Solution (Python):
import sys
import math
import bisect

def solve(a, b):
    n = b - a - 1
    A = sum(list(range(1, n + 1)))
    return A - a

def main():
    a, b = map(int, input().split())
    print(solve(a, b))

if __name__ == "__main__":
    main()

Solution (Python):
a,b = map(int,input().split())
dum = b-a
total = 0
for i in range(dum,0,-1):
    total += i
print(total-b)

Solution (Python):
a,b=map(int,input().split())
c=b-a
ans=((1+c)*c)//2-b
print(ans)

Solution (Python):
a,b = map(int,input().split())
div = b-a
ans = 0
for i in range(1,1000):
    if div==i:
        break
    ans += i
print(ans-a)

Solution (Python):
a,b=map(int,input().split())
t=b-a
print(t*(1+t)//2-b)

Solution (Python):
a,b = map(int,input().split())
print(sum(range(b-a+1))-b)

Solution (Python):
a,b=(map(int,input().split()))
ans=0
for i in range(1,b-a):
  ans+=i
print(ans-a)

Solution (Python):
a, b = map(int, input().split())
n = abs(b-a)
val = int(n*(n+1)/2)
print(val-b)

Solution (Python):
ab = input().split()
a,b = int(ab[0]),int(ab[1])
d = []
z = b - a 
if ((z-1)*z)/2 >a and ((z+1)*(z+2))/2 > b:
    x,y = ((z-1)*z)/2, ((z+1)*(z+2))
print(int(x - a))

Solution (Python):
a, b = map(int, input().split())

for i in range(1000):
  if b-a == i:
    print(i*(i-1)//2 - a)
    break

Solution (Python):
import sys
input = sys.stdin.readline

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

diff = b - a
sum = diff
for i in range(diff):
  sum += i

print(int(sum - b))

Solution (Python):
a, b = map(int, input().split())
d = b - a
print(d * (d + 1) // 2 - b)

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    a, b = map(int, input().split())

    
    
    for i in range(1, 999):
        Xa = i * (i + 1) // 2 - a
        Xb = (i + 1) * (i + 2) // 2 - b
        if Xa == Xb:
            ans = Xa
            break

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import sys
sys.setrecursionlimit(100000) 
def f(n):
    if n == 0:
        return 0
    else:
        return n + f(n-1)
a, b = list(map(int,input().split()))
i1 = 1
i2 = 2
while True:
    if b - a == f(i2) - f(i1):
        break
    i1 += 1
    i2 += 1
print(f(i1) -a)

Solution (Python):
a,b = map(int, input().split())
dif = b-a
tower_r = ((1+dif)*dif)//2
print(tower_r-b)

Solution (Python):
a, b = map(int, input().split())
h = 0
hs = []
for i in range(1, 1000):
    h += i
    hs.append(h)
for i in range(998):
    if (hs[i] - a) == (hs[i + 1] - b):
        print(hs[i] - a)
        exit()

Solution (Python):
a,b = map(int,input().split())
ans = sum(i for i in range(1,b-a)) -a
print(ans)

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

Solution (Python):
a, b = map(int, input().split())
height = (1 + (b - a)) * (b - a) / 2
print(int(height - b))

Solution (Python):
A, B = map(int, input().split())

A_x = (B-A)-1

print(sum(list(range(A_x+1)))-A)

Solution (Python):
a, b = map(int, input().split())
h = 0
for i in range(1, b - a):
  h += i
print(h - a)

Solution (Python):
a,b=map(int,input().split());print((b-a)*(b-a+1)//2-b)

Solution (Python):
a, b = map(int, input().split())

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

Solution (Python):
a,b = map(int,input().split())
delta = b-a
tower_b = (delta+1)*delta//2
print(tower_b - b)

Solution (Python):
a,b = map(int, input().split())
n = b-a
bl = n*(n+1) //2
print(bl-b)

Solution (Python):

import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi

a, b = ri_()
print((b - a - 1) * (b - a) // 2 - a)

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

Solution (Python):
from statistics import median


from fractions import gcd
from itertools import combinations 
from collections import deque
from collections import defaultdict
import bisect










import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))

def main():
    a, b = readInts()
    print(int((b - a) * (b - a + 1)//2 - b))
if __name__ == '__main__':
  main()

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

Solution (Python):
a, b = map(int, input().split())

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

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

Solution (Python):
A, B = map(int, input().split())
H = [i * (i + 1) // 2 for i in range(1, 1001)]

for l, r in zip(H, H[1:]):
    if r - l == B - A:
        print(r - B)
        exit()

Solution (Python):


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

tower = [1]*999
for i in range(1,999):
  tower[i] = tower[i-1]+i+1

print(tower[b - a - 1] - b)

Solution (Python):
a,b = map(int,input().split())
ans = 0
for i in range(b-a):
  ans += i
print(ans-a)

Solution (Python):
import numpy as np
a, b = map(int, input().split())

num = [i+1 for i in range(999)]

tower = np.cumsum(num)

for j in range(len(tower) - 1):
    if tower[j] - a == tower[j+1] - b:
        print(tower[j] - a)
        break
    else:
        continue

Solution (Python):
A, B = map(int, input().split())
h = B-A
ans = 0
for i in range(1, h):
  ans += i
print(ans-A)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7

a,b=MI()
c=b-a
ans=(c*(c+1))//2-b
print(ans)

Solution (Python):






def main():
    a, b = map(int, input().split())
    dif = b - a
    
    return dif * (dif-1) // 2 - a


print(main())

Solution (Python):
a, b = map(int, input().split())
diff = b - a
print((diff + 1)*diff//2 - b)

Solution (Python):
a, b = map(int, input().split())
s = 0
for i in range(1, b-a+1):
    s += i
print(s-b)

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

gap = b-a

def sum_m(a):
    l=0
    for i in range(1,a+1):
        l+=i
    return l

n_b = sum_m(gap)
print(n_b-b)

Solution (Python):
a,b=map(int,input().split())
sa=b-a
he=0
for i in range(1,sa):
  he+=i
print(he-a)

Solution (Python):
a, b = map(int, input().split())
k = b - a - 1
a_k = (k + 1) * (k + 2) //2
x = a_k -b
print(x)

Solution (Python):
a, b = map(int, input().split())

val = [0] * 1000
for i in range(1, 1000):
    val[i] = val[i - 1] + i

n = b - a - 1
ans = val[n] - a
print(ans)

Solution (Python):
a,b=map(int,input().split())
print((b-a)*(b-a-1)//2-a)

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

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

Solution (Python):
a,b=map(int,input().split())
l=[0]*999
for i in range(1,1000):
    l[i-1]=(i*(i+1)//2)

for i in range(998):
    if (b-a)==l[i+1]-l[i]:
        ans=l[i]-a
print(ans)

Solution (Python):
a, b = map(int, input().split())
snow = b - a
h = []
tmp = 0
for i in range(1,1000):
    tmp += i
    h.append(tmp)
x =[h[j+1] - h[j] for j in range(998)]
y = x.index(snow)
print(h[y] - a)

Solution (Python):
a, b = map(int, input().split())
d = b - a
print(sum(i for i in range(1, d+1)) - b)

Solution (Python):
a, b = map(int, input().split())
num = 0
for i in range(1, b-a+1):
    num += i
print(num - b)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = MAP()
print((b - a)*(b - a - 1) // 2 - a)

Solution (Python):
a,b=map(int,input().split())
sa=b-a
takai=(sa*(sa+1))//2
print(takai-b)

Solution (Python):
a, b = map(int, input().split())
d = b - a

ans = (1 + d)*d//2 - b

print(ans)

Solution (Python):
a, b = map(int, input().split())
diff = b - a
h = 0

for i in range(diff):
    h += i + 1

ans = h - b

print(ans)

Solution (Python):
a,b=map(int,input().split())
diff = b-a
tall = sum([i for i in range(1, diff+1)])
print(tall-b)

Solution (Python):
def resolve():
    a,b=map(int, input().split())
    print((1+b-a)*(b-a)//2-b)
resolve()

Solution (Python):
a, b = map(int ,input().split())
n = b-a
print(n*(n-1)//2-a)

Solution (Python):
a, b = map(int, input().split())

tmp = 0
for i in range(1, 499501):
    tmp += i
    if i == b-a: print(tmp-b)

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

Solution (Python):
a, b = map(int, input().split())
h = 0
for i in range(1, b - a):
    h += i
print(h - a)

Solution (Python):
a,b =map(int,input().split())

n=b-a
print(int(0.5*n*(n+1)-b))

Solution (Python):
a,b=map(int,input().split())
n=0
for i in range(1,(b-a)+1):
    n+=i
print(n-b)

Solution (Python):
a,b=map(int,input().split())
count=1
for i in range(2,1000):
    if a-count==b-count-i:
        print(count-a)
        break
    count+=i

Solution (Python):
a,b = map(int,input().split())
r = b-a
ans = 0
for i in range(r):
    ans += i

print(ans - a)

Solution (Python):
a,b=map(int,input().split())
dif=b-a
high=0
for i in range(1,dif+1):
    high+=i
print(high-b)

Solution (Python):
a,b=map(int, input().split())
print('{:.0f}'.format((b-a)*(b-a+1)/2-b))

Solution (Python):
a,b = map(int,input().split())

for i in range(2,1000):
    tmp_a = sum(range(1,i)) - a
    tmp_b = sum(range(1,i+1)) - b
    if tmp_a == tmp_b:
        print(tmp_a)
        break

Solution (Python):
a,b= [int(x) for x in input().split()]

n = b - a -1
ans = - a

for i in range(1, n+1):
    ans += i

print(ans)

Solution (Python):
a, b = map(int, input().split())
print(sum(range(1, b - a)) - a)

Solution (Python):
a, b = map(int, input().split())
t = [0]
for i in range(1, 1000):
    t.append(t[i-1] + i)
print(t[b-a] - b)

Solution (Python):
a,b=map(int,input().split())
sum=0
l=[]
for i in range(1,1000):
  sum+=i
  l.append(sum)
for j in range(998):
  if l[j]-a==l[j+1]-b:
    print(l[j]-a)

Solution (Python):
a, b=map(int, input().split())
n=b-a-1
ans=(-a-b+n**2 +2*n+1)//2
print(ans)

Solution (Python):
def main():
    a, b = map(int, input().split())
    t = 0
    r = -10**9
    for i in range(1, 1000):
        t += i
        if t <= i:
            continue
        if r == t - b:
            return r
        r = t - a

print(main())

Solution (Python):
def main():
    a, b = map(int, input().split())
    c = b - a
    x = (1 + c) * c // 2
    print(x - b)
main()

Solution (Python):
a,b = map(int,input().split(" "))
diff = b-a
t_b = (diff+1)*diff/2
print(int(t_b-b))

Solution (Python):
a,b = map(int,input().split())
print((b-a-1)*(b-a)//2-a)

Solution (Python):

a,b = map(int,input().split())
diff = abs(b-a)
r = 0

for i in range(1,diff+1):
    r += i
print(r-b)

Solution (Python):
a, b = map(int, input().split())

s = 0
for i in range(1, 1000):
    s += i
    if i == b - a:
        print(s - b)
        exit

Solution (Python):
icase=0
if icase==0:
    a,b=map(int,input().split())
    n=b-a-1
    print(n*(n+1)//2-a)

Solution (Python):
icase=0
if icase==0:
    import sys
    a,b=map(int,input().split())
    for i in range(1,999):
        isum=(i*(i+1))//2-a
        for j in range(i,1000):
            jsum=(j*(j+1))//2-b
            if jsum==isum and 1<=jsum and j==i+1:
                print(jsum)
                sys.exit()

Solution (Python):
a,b = map(int,input().split())
d = b-a
print(d*(d+1)//2-b)

Solution (Python):
A,B=map(int,input().split())
H=[0]*1000

i=1
while i<=999:
    H[i]=i+H[i-1]
    i+=1

print(H[B-A]-B)

Solution (Python):
A,B=map(int,input().split())
H=[0]*1000

i=1
while i<=999:
    H[i]=i+H[i-1]
    i+=1

ans=0
while True:
    if (A+ans in H)and(B+ans==H[H.index(A+ans)+1] in H):
        break
    else:
        ans+=1
    
print(ans)

Solution (Python):
a,b=map(int,input().split())
i=b-a
ans=0
for j in range(i):
  ans+=j
print(ans-a)

Solution (Python):
a, b = map(int, input().split())
length = 0
for i in range(1, b-a+1):
  length += i
print(length - b)

Solution (Python):
a,b = map(int,(input().split()))

def s(N):
    c = 0
    for i in range(1,N+1):
        c += i
    return c

print(s(b-a)-b)

Solution (Python):
a, b = map(int, input().split())
A = sum([i for i in range(b-a)])
B = sum([i for i in range(b-a+1)])
print(A-a)

Solution (Python):
a, b = map(int,input().split())
N = b-a
print(N*(N-1)//2 - a)

Solution (Python):
a,b=map(int, input().split())
d=b-a
t=0
while d>0:
  t+=d
  d-=1
print(t-b)

Solution (Python):

import io

nim, mike = map(int, input().split())
k = mike - nim
print(k * (k + 1) // 2 - mike)

Solution (Python):
a,b = map(int,input().split())
n = b-a
tower = ((n+1)*n)/2
print(int(tower-b))

Solution (Python):
a,b=map(int,input().split())
n=b-a
summy=((n+1)*n)/2
print(int(summy-b))