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



Sample input:
8 13


Sample output:
2

Submission status: Accepted

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

c = b - a

d = (c - 1) * c / 2

print(int(d - a))

Submission status: Accepted

Solution code:
def main():
    a,b = map(int, input().split())
    N = b-a
    t = N*(N+1)//2
    return t-b

if __name__ == "__main__":
    print(main())

Submission status: Accepted

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

right_tower_height = 0

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

print(right_tower_height - b)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

if __name__=="__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = [int(elem) for elem in input().split(' ')]

diff_height = (b - a)

snow_height = int(((diff_height - 1) * diff_height) / 2  - a)
print(snow_height)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = [int(i) for i in input().split()]
n = b - a - 1
c = -a + n * (n + 1) // 2
print(c)

Submission status: Accepted

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

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

Submission status: Accepted

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

c = b - a
count = sum(range(c + 1)) - b

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

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

k = b-a

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

Submission status: Accepted

Solution code:
def abc099_b():
    a, b = map(int, input().split())
    x = sum([i for i in range(b-a)])
    return x-a


print(abc099_b())

Submission status: Accepted

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

dif = b - a

n = dif - 1

h_m = n * (n+1) / 2

print(int(h_m - a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 整数の入力
A, B = input().split(" ")
A =int(A)
B = int(B)

n = B - A
print(int(0.5 * n * (n+1)-B))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def inpl(): return map(int, input().split())
A, B = inpl()
D = B - A
S = D*(D-1)//2
print(S-A)

Submission status: Accepted

Solution code:
import sys,collections,math;sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

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

Submission status: Accepted

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

Submission status: Accepted

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

n = b - a
tall_b = sum(range(n + 1))

print(tall_b - b)

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(sum([n for n in  range(b-a)]) - a)

Submission status: Accepted

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

result = 0

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
num=b-a
tower=sum(i for i in range(num))
print(tower-a)

Submission status: Accepted

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

N = b - a

sum = N * (N + 1) // 2

print(sum - b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B = [int(_) for _ in input().split()]

d = B - A

x = 0
for i in range(d):
    x += i

print(x - A)

Submission status: Accepted

Solution code:
a,b=[int(i) for i in input().split()]
n=(b-a)
nn=n*(n+1)/2
ans=int(nn-b)
print(ans)

Submission status: Accepted

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

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

    print(s-a)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B = [int(x) for x in input().split()]

d = B - A
t = sum(list(range(d)))
print(t - A)

Submission status: Accepted

Solution code:
#!python
# -*- coding: utf-8 -*-


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

    a_height = sum(range(1, b - a))

    print(a_height - a)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print(p-b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = [int(i) for i in input().split()]
differ = a[1]-a[0]
answer = int((1+differ)*differ/2-a[1])
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

dif = b - a
total = dif * (dif - 1) // 2

print(total - a)

Submission status: Accepted

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

Submission status: Accepted

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

n = b - a

h = (n ** 2 + n) / 2 - b

h = int(h)

print(h)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,raw_input().split())
dif = b-a
ans = 0
for x in range(dif):
  ans += x
print ans-a

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B
a, b = map(int, input().split())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

a, b = map(int, input().split())
A = [1]
for i in range(2, 1000):
    A.append(A[i-2] + i)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

c=b-a

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

print(h-b)

Submission status: Accepted

Solution code:
a,b=[int(x) for x in raw_input().split()]
n=b-a
print n*(n+1)/2-b

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
n = b-a
print(int(0.5*n*(n+1)-b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
a,b=[int(i) for i in input().split()]

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

Submission status: Accepted

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

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

print(n-a)

Submission status: Accepted

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

n = b-a

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

print(c-b)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    a,b = LI()
    t = [1]
    for i in range(2,1000):
        t.append(t[-1]+i)
    s = b-a
    c = 0
    for i in range(1000):
        if t[i+1] - t[i] == s:
            c = i
            break

    return t[c] - a


print(main())

Submission status: Accepted

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

Submission status: Accepted

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

print(sum(range(1, b-a+1))-b)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
tmp = (y-x)
print(((tmp+1)*tmp)//2 - y)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(total - b)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

a, b = na()
c = b-a

print(c*(c-1)//2-a)

Submission status: Accepted

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

Submission status: Runtime Error

Solution code:

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

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

for ans in range(1,10000):
    west, east = a+ans, b+ans
    for j in range(998):
        if west==tou[j] and east==tou[j+1]:
            # print("west,wast,j,ans", west,east,j,ans)
            out=ans
            break
print(out)

Submission status: Runtime Error

Solution code:

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

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

for ans in range(1,1001):
    west, east = a+ans, b+ans
    for j in range(998):
        if west==tou[j] and east==tou[j+1]:
            # print("west,wast,j,ans", west,east,j,ans)
            out=ans
            break
print(out)

Submission status: Runtime Error

Solution code:
def fib(n):
    if n>0:
        return n+fib(n-1)
    else:
         return 0

a,b=map(int,input().split())
s=b-a
print(fib(s)-b)

Submission status: Runtime Error

Solution code:
def fib(n):
    if n>0:
        return n+fib(n-1)
    else:
         return n

a,b=map(int,input().split())
memo=[0 for i in range(1000)]
s=b-a
for i in range(1000):
    if fib(i+1)-fib(i)==s:
        print(fib(i)-a)
        break

Submission status: Runtime Error

Solution code:
def Gauss_sum(n):
  return n*(n+1)//2
a,b=map(int,input())
for i in range(999):
  if Gauss_sum(i+1)-a == Gauss_sum(i+2)-b:
    print(Gauss_sum(i+1)-a)
    break

Submission status: Runtime Error

Solution code:
import itertools

n, m = map(int, input().split())
l = itertools.accumulate([1] * 999)
print(l[m-n-1] - m)

Submission status: Runtime Error

Solution code:
a, b = int(input())
X = b - a
ans = 0
for i in range(X):
    ans += i
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
def h(d):
    if d==1:
        return 1
    return h(d-1)+d
print(h(b-a)-b)

Submission status: Runtime Error

Solution code:
import sys
a,b = map(int,input().split())
sum = 0
for i in range(1,1000):
while(a > sum):
	i = 1
    sum += 1
    i += 1
print(sum-a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split)
z =[]

c = 0
for i in 999:
  c +=i
  z.append(c)

w =max(a,b)-min(a,b)
if (w==z[i+1]-z[i]):
  print(z[i]-a)

Submission status: Runtime Error

Solution code:
a,b = int(input())
z =[]

c = 0
for i in 999:
  c +=i
  z.append(c)

w =max(a,b)-min(a,b)
if (w==z[i+1]-z[i]):
  print(z[i]-a)

Submission status: Runtime Error

Solution code:
ab = list(map(int,input().split()))
a,b = ab[0],ab[1]
d = []
for i in range(100):
    if (i*(i+1))/2 >a and ((i+1)*(i+2))/2 > b:
        d.append(i)
x,y = (d[0]*(d[0]+1))/2, ((d[1]+1)*(d[1]+2))/2
print(int(x - a))

Submission status: Runtime Error

Solution code:
ab = list(map(int,input().split()))
a,b = ab[0],ab[1]
d = []
for i in range(999):
    if (i*(i+1))/2 >a and ((i+1)*(i+2))/2 > b:
        d.append(i)
x,y = (d[0]*(d[0]+1))/2, ((d[1]+1)*(d[1]+2))/2
print(int(x - a))

Submission status: Runtime Error

Solution code:
i = 1
a = int(input())
b = int(input())
m = 0
while m <= a:
    m += i
    i += 1

diff = abs(m - a)
print(diff)

Submission status: Runtime Error

Solution code:
i = 1
a = int(input())
b = int(input())
sum = 0
while sum <= a:
    sum += i
    i += 1

diff = abs(sum - a)
print(diff)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
A, B = map(int, input())

A_x = (B-A)-1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
def func(n):
  if n == 0:
    return 0
  else:
    return func(n-1) + n
print(func(b-a-1) - a)

Submission status: Runtime Error

Solution code:
a, b = int(input())
            
print((b-a)*(b-a+1)//2-b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def factorial(n):
    if n == 1:
        return 1
    else:
        return n + factorial(n - 1)


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

diff = b - a

print(factorial(diff) - b)

Submission status: Runtime Error

Solution code:
N = int(input())
now = 0
ans = 0
for i in range(1,N+1):
    if i%2 == 0:
        continue
    else:
        for j in range(1,i+1):
            if i%j == 0:
                now += 1
        if now == 8:
            ans += 1
        now = 0
print(ans)

Submission status: Runtime Error

Solution code:
10 11a = [int(i) for i in input().split()]
b=a[0]
c=a[1]
x=c-b
print(round((x+1)*x/2)-c)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <iomanip>
#include <string>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <queue>
#include <memory>
#include <fstream>
#include <strstream>


#pragma GCC optimize("no-stack-protector,Ofast,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,popcnt,abm,mmx,tune=native,avx,avx2")

#define int long long
#define ld long double
#define eb emplace_back
#define pb pop_back
#define mp make_pair
#define ss second
#define ff first
#define sqr(x) (x) * (x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()

typedef int(*func)(int a, int b);

using namespace std;

const int INF = 1e9 + 7;
const int B = 299;
const int MOD = 1e9 + 123;
const ld EPS = 1e-7;
const ld PI = 3.14159265358979323;
const int MAXN = 2100;

random_device rd;
mt19937 get_rand(rd());

int gcd(int a, int b) {
	return (!a ? b : gcd(b % a, a));
}

vector < vector < int > > g;
bool u[2010], c[2010];

bool dfs(int v, bool z) {
	u[v] = 1;
	c[v] = z;
	for (auto i : g[v]) {
		bool k = 1;
		if (!u[i])
			k = dfs(i, !z);
		if (c[i] == z || !k)
			return 0;
	}
	return 1;
}


signed main() {
	//ifstream cin("input.txt");
	//ofstream cout("output.txt");
#ifdef _LOCAL
	freopen("output.txt", "w", stdout);
	freopen("input.txt", "r", stdin);
#endif
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(0);
	srand(time(NULL));

	int t = 1;
	//cin >> t;
	while (t--) {
		int a, b;
		cin >> a >> b;
		int n = b - a - 1;
		cout << n * (n + 1) / 2 - a << endl;
	}
	return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def func(x):
    if x == 1:
        return 1
    else:
        return x + func(x - 1)


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

for i in range(1, 999):
    if func(i) - a == func(i + 1) - b:
        print(func(i) - a)
        break

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b=map(int,input().split())
num=0
nums=[]
for i in range(1,1000):
    num+=i
    nums.append(num)
for i in range(1,999):
    if nums[i]-a==num[i+1]-b:
        print(nums[i])

Submission status: Runtime Error

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

def calc(n):
    if n==1:
        return 1
    else:
        return n+calc(n-1)


diff = b-a
tall = calc(diff)
print(tall-b)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
count = 0
n = 0
l = []

for i in range(10):
  n += count + 1
  count += 1
  if n > min(a, b):
    l.append(n-min(a,b))
  if n > max(a, b) and n-max(a,b) in l:
    N = n-max(a,b)
    break
if len(l) == 1:
  print(1)
else:
  print(N)

Submission status: Runtime Error

Solution code:
n = int(input())
if n < 1000:
  print('ABC')
else:
  print('ABD')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

n=b-a

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

Submission status: Runtime Error

Solution code:
a, b ＝ map(int, input().split())
tower = []
tmp = 0

for i in range(1, 1000):
    tmp += i
    tower.append(tmp)
    
count = b - a

print(tower[count - 1] - b)

Submission status: Runtime Error

Solution code:
a, b ＝ map(int, input().split())
tower = []
tmp = 0

for i in range(1, 1000):
    tmp += 1
    tower.append(tmp)
    
count = b - a

print(tower[count - 1] - b)

Submission status: Runtime Error

Solution code:
a, b ＝ map(int, input().split())
tower = []
tmp = 0

for i in range(1, 1000):
    tmp += 1
    tower.append(tmp)
    
count = a - b

print(tower[count - 1] - b)

Submission status: Runtime Error

Solution code:
a,b = (int(i) for i in input().split())
def ssum(n):
  if n == 1:
    return 1
  else:
    return n + ssum(n-1)
print(ssum(b-a)-b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
t = b - a
n = [1]
x = 1

for i in range(2,999):
  x = i + x
  n.append(x)

else:
  for j in range(0,1000):
    if n[j+1] - n[j] == t:
      break
print(n[j] - a)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
t = b - a
n = [1]
x = 1

for i in range(2,999):
  x = i + x
  n.append(x)

else:
  for j in range(0,len(n)):
    if n[j+1] - n[j] == t:
      break
print(n[j] - a)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
t = b - a
n = [1]
x = 1

for i in range(2,999):
  x = i + x
  n.append(x)

else:
  for j in range(0,len(n) + 1):
    if n[j+1] - n[j] == t:
      break
print(n[j] - a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# B - Stone Monument
N, M = map(int,input().split())

tmp= (M-N)*( M-N+1)/2

ans( tmp-N)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

def f(x):
    if x == 0:
        return x
    return x + f(x - 1)

diff = b - a
east = f(diff)
print(east - b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
c = b-a
#高い方の塔の高さがsum(1,2,...,c)=c(c+1)/2になります
h = c(c+1)//2
print(h-b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
df = b-a
nums = []
cnt = 0
for i in range(1,1000):
    cnt += i
    nums.append(cnt)
    if nums[i] - nums[i-1] == df:
        print(nums[i] - b)
        exit()

Submission status: Runtime Error

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

i = 0
s = 0

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

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
diff = b - a
def tower(n):
    if n < 1:
        return 0
    return n + tower(n - 1)
print(int(tower(diff) - b))

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
diff = b - a
def tower(n):
    if n < 1:
        return 0
    return n + tower(n - 1)
print(tower(diff) - b)

Submission status: Runtime Error

Solution code:
a,b = map(int, input().split())
diff = b - a - 1
def tower(n):
    if n < 1:
        return 0
    return n + tower(n - 1)
print(tower(diff) - a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#A
def A():
    n = II()
    if n < 1000:
        print("ABC")
    else:
        print("ABD")
    return

#B
def B():
    a, b = LI()
    x = b - a - 1
    print(a - (1 + x) * x // 2)
    return

#C
def C():
    n = II()
    dp = [inf for i in range(n + 1)]
    ans = [1]
    x = 6
    while x <= n:
        ans.append(x)
        x = x * 6
    x = 9
    while x <= n:
        ans.append(x)
        x = x * 9
    ans.sort()
    for i in ans:
        dp[i] = 1
    for i in range(1, n + 1):
        if not i in ans:
            a = bisect.bisect_left(ans, i)
            for k in range(a):
                dp[i] = min(dp[i - ans[k]] + 1, dp[i])
    print(dp[n])
    return

#D
def D():
    n, c = LI()
    D = LIR(c)
    C = LIR_(n)
    CL = list(itertools.permutations(range(c), 3))
    ans = inf
    amari0 = [0 for i in range(30)]
    amari1 = amari0[::1]
    amari2 = amari0[::1]
    for y in range(n):
        for x in range(n):
            amari = (x + y) % 3
            if amari == 0:
                amari0[C[y][x]] += 1
            if amari == 1:
                amari1[C[y][x]] += 1
            if amari == 2:
                amari2[C[y][x]] += 1
    for c0, c1, c2 in CL:
        ansb = 0
        for i in range(c):
            ansb += D[i][c0] * amari0[i]
            ansb += D[i][c1] * amari1[i]
            ansb += D[i][c2] * amari2[i]
        ans = min(ans, ansb)
    print(ans)
    return

#Solve
if __name__ == '__main__':
    Ⓑ()

Submission status: Runtime Error

Solution code:
N = int(input())
S = list(input())
r = []
c = 0
for x in range(N):
  a = S[:x]
  b = S[x:]
  for y in set(a):
    if y in b:
      c += 1
  r.append(c)
  c = 0
print(max(r))

Submission status: Runtime Error

Solution code:
def height(n):
    return sum([i for i in range(n+1)])

tower = []

for i in range(1, 1000):
    tower.append(height(i))

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

for i in tower:
    if tower[i] > a:
        ind = i-1
        break

print(abs(tower[ind] - a))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

a, b = map(int,input().split())
c = b - a
for i in range(1,999):
  d = sum(range(i+1)) - sum(range(i))
  if d == c:
    e = sum(range(i)) - a
print(e)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod=1e9+7;

int main(){
    int a, b, dif, height_w=0, height_e=1;
    cin >> a >> b;
    dif = b-a;
    for(int i=1; i<1000; i++){
        height_w += i;
        height_e += i+1;
        if(height_e - height_w == dif) break;
    }
    cout << height_w - a;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = map(int, input())

n = b - a
original_b = n * (n + 1) // 2

print(original_b - b)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
c = [0]
for i in range(1, 999):
    c.append(c[i-1]+i)
    if c[i-1]-a > 0:
        ans = c[i-1]-a
        break
print(ans)

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
c = [0]
for i in range(1, 999):
    c.append(c[i-1]+i)
    if c[i-1]-a >= 0:
        ans = c[i-1]-a
        break
print(ans)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
i=2
a=1
while a+i<A:
    a+=i
    i+=1
    ans=a+i
print(ans-A)

Submission status: Runtime Error

Solution code:
a,b = map(int,input())
tmp = b - a
count = 0
for i in range(tmp):
  count += i+1
print(count - a)

Submission status: Runtime Error

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

l = [1]
for i in range(2, 999):
    l.append(l[i-2] + i)
    
diff = b - a

print(l[diff-1] - b)

Submission status: Runtime Error

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

def calc(n):
    count = 0
    for i in range(1, n+1):
        count += i
    reversed(count)

print(calc(b - a) - b)

Submission status: Runtime Error

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

def calc(n):
    if n == 1:
        return 1
    else:
        return calc(n-1) + n

print(calc(b - a) - b)

Submission status: Runtime Error

Solution code:
a=[0]
tmp=0
for i in range(1,101):
    tmp+=i
    a.append(tmp)

A,B=map(int,input().split())
print(a[B-A]-B)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = map(int, input().split())
diff = b - a

def generate(n):
    if n == 1:
        return 1
    return generate(n-1) + n

generate(diff) - b

Submission status: Runtime Error

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

c = 0

def sigma(x):
	if x <= 0:
		return x
	return x + sigma(x-1)
  
for i in range(1,1000):
	c += 1
	if sigma(i) > a:
		break
        
print(sigma(c) - a)