Harryxun/stf_run huggingface dataset:
from math import sqrt, floor
from functools import reduce


def divisors(a):
    return {i for i in range(1, floor(sqrt(a)) + 1) if a % i == 0}\
        .union({a // i for i in range(1, floor(sqrt(a)) + 1) if a % i == 0})


def greatest_common_divisor(a, b):
    return max(divisors(a).intersection(divisors(b)))


def greatest_common_divisor_of(lst):
    return reduce(greatest_common_divisor, lst)


X = int(input().split()[1])
xi = list(map(int, input().split()))
x = [x - X for x in xi]
print(greatest_common_divisor_of(x))

### FIXED CODE ###

from functools import reduce
from fractions import gcd

X = int(input().split()[1])
x = [abs(int(x) - X) for x in input().split()]

print(reduce(gcd, x))
from functools import lru_cache

H,N = map(int,input().split())
atk=[]
MP=[]
arr=[]
for i in range(N):
  n,a=input().split()
  arr.append([int(n),int(a)])
arr.sort()

for i in range(N):
  atk.append(arr[i][0])
  MP.append(arr[i][1])

@lru_cache(maxsize=100000000)
def fx(H):
  if H <= 0:
    return 0
  arr = []
  for i in range(len(atk)):
    kaisuu = int(H // atk[i])
    if kaisuu >= 1:
      for j in range(1,kaisuu+1):
        c = int(H - atk[i]*j)
        b = int(fx(c) + MP[i]*j)
        arr.append(b)   
    else:
      b = int(fx(H - atk[i]) + MP[i])
      arr.append(b)
  return min(arr)

a = fx(H)
print(a)

### FIXED CODE ###

def knapsack(N,W,weight,value):
  #初期化
  inf=float("inf")
  dp=[[inf for i in range(W+1)] for j in range(N+1)]
  dp[0][0]= 0
  #DP
  for i in range(N):
    for w in range(W+1):
      if 0 <= w-weight[i]: #dp[i][w-weight[i]の状態にi番目の荷物が入る可能性がある
        dp[i+1][w]=min(dp[i+1][w-weight[i]]+value[i], dp[i][w])
      else:
        dp[i+1][w]=dp[i][w]
  return dp
 
H,N = map(int,input().split())
 
weight=[]
value=[]
for i in range(N):
    n,a=input().split()
    weight.append(int(n))
    value.append(int(a))
MAX = max(weight)
dp = knapsack(N,H+MAX,weight,value)
 
print(min(dp[N][H:H+MAX]))
import fractions
N, M = map(int, input().split())

k = M // N　+ 1
ans = 1
for i in reversed(range(1, k+1)):
    if ans > i:
        break
    ans = max(ans, max(fractions.gcd(i, M - (N-1)*i), 1))

print(ans)


### FIXED CODE ###

import fractions
N, M = map(int, input().split())

k = M // N + 1
ans = 1
for i in reversed(range(1, k+1)):
    if ans > i:
        break
    tmp = max(M - (N-1)*i, 1)
    if tmp % i == 0:
        ans = max(ans, i)

print(ans)
import sys
lines = sys.stdin.readlines()

S = str(lines[0])
X = []

for i in range(len(S)):
  a = int(S[i:])
  c = a-(a//2019)*2019
  X.append(c)

X.sort()
flag =1
n = 0
for i in range(len(X)-1):
  if X[i]==0:
    n +=1
  if X[i]==X[i+1]:
    flag += 1
  else:
    n += flag*(flag-1)//2
    flag = 1
 
print(n)


### FIXED CODE ###

S = str(input())

#10**nのmod計算
A = []
p =1
for i in range(len(S)):
  A.append(p)
  p = p*10%2019

#左からi文字以降の数字列のmod計算
X = []
a = 0
for i in range(len(S)):
  a = (a + int(S[len(S)-i-1])*A[i]) %2019
  X.append(a)
X.sort()
flag =1
n = 0

#modが同じになる組み合わせ、またはもともとmodが0になる数字列の個数の総和計算
for i in range(len(X)-1):
  if X[i]==0:
    n +=1
  if X[i]==X[i+1]:
    flag += 1
  else:
    n += int(flag*(flag-1)/2)
    flag = 1
n += int(flag*(flag-1)/2)
if X[len(X)-1]==0:
  n +=1
print(n)
import math
x=input().split()
a=int(x[0])
b=int(float(x[1])*100)
c = int(a * b)
print(round(c/100.0,2)


### FIXED CODE ###

import math
x=input().split()
a=int(x[0])
b=int(x[1].replace('.',''))
c = int(a * b)
print(c//100)
line = input().split()
N = line[0]
A = line[1]
B = line[2]

if A > B:
    cnt = 0
elif N == 1:
    cnt = 0
elif A == B:
    cnt = 1
else:
    cnt=(2-N)*A+(N-2)*B+1

print(cnt)

### FIXED CODE ###

a,b,c = map(int,input().split())
if a<=1:
    if b==c:
        print(1)
    else:
        print(0)
elif b>c:
    print(0)
else:
    print((a-2)*(c-b)+1)
a = int(input())
b = int(input())
c = a*b


if c % 2==0:
  print("even")
elif c % 2==1:
  print("odd")
  
	

### FIXED CODE ###

a,b=map(int,input().split())
if (a*b) % 2:
  print("Odd")
else:
  print("Even")
import math

n = int(input())
w = list(map(int,input().split()))

min = math.inf

for i in range(1,n):
    sa = abs( sum(w[0:i]) - sum(w[i:]) )
    if(sa < min):
        min = sa

print(min)

### FIXED CODE ###

n = int(input())
w = list(map(int,input().split()))

min = float('inf')

for i in range(1,n):
    sa = abs( sum(w[0:i]) - sum(w[i:]) )
    if(sa < min):
        min = sa

print(min)
input()
l = list(map(int,input().split()))
s = 0
s += 1/i for i in l
print(round(1/s,3))

### FIXED CODE ###

input()
l = list(map(int,input().split()))
s = sum(1/i for i in l)
print(1/s)
r,g,b,n = map(int,input().split())
ans = 0

for i in range(n+1):
    for j in range(n+1):
            if (r*i + g*j + b*(n+1 - i - j)) == n:
                ans += 1
print(ans)

### FIXED CODE ###

import math

n,k = map(int,input().split())
print(n-k+1)
N = int(input())
men = []
for _ in range(N):
    H,P = map(int,input().split())
    men.append((H,P,H+P))
men.sort(key=lambda x: x[2])

inf = max(H)+1
dp = [[inf]*(N+1) for _ in range(N+1)]
dp[0][0] = 0
for i in range(1,N+1):
    h,p,a = men[i-1]
    for j in range(1,N+1):
        if dp[i-1][j-1] <= h:
            dp[i][j] = min(dp[i-1][j],dp[i-1][j-1]+p)
        else:
            dp[i][j] = dp[i-1][j]

for j in range(N,-1,-1):
    if dp[-1][j] != inf:
        print(j)
        break


### FIXED CODE ###

N = int(input())
men = []
for _ in range(N):
    H,P = map(int,input().split())
    men.append((H,P,H+P))
men.sort(key=lambda x: x[2])

maxH = max(men)[0]
inf = maxH+1
#dp[i][j] -> i人目までみたとき、j人が座布団を積む場合の最小枚数
dp = [[-1]*(N+1) for _ in range(N+1)]
dp[0][0] = 0
for i in range(1,N+1):
    h,p,a = men[i-1]
    for j in range(1,N+1):
        if 0 <= dp[i-1][j-1] <= h:
            if dp[i-1][j] == -1:
                dp[i][j] = dp[i-1][j-1]+p
            else:
                dp[i][j] = min(dp[i-1][j],dp[i-1][j-1]+p)
        else:
            dp[i][j] = dp[i-1][j]

for j in range(N,-1,-1):
    if dp[-1][j] != -1:
        print(j)
        break
def base10to(n, b):
　  if (int(n/b)):
　　    return base10to(int(n/b), b) + str(n%b)
    else: 
        return str(n%b)
N, K=map(int, input().split())
x = base10to(N,K)
print(len(x))

### FIXED CODE ###

def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    else: 
        return str(n%b)
N, K=map(int, input().split())
x = base10to(N,K)
print(len(x))
a=int(input())
a=25-a
print("Christmas ", end="")
for i in a:
  print("Eve ", end="")

### FIXED CODE ###

a=int(input())
a=25-a
print("Christmas ", end="")
for i in range(a):
  print("Eve ", end="")
def q3():
    def lcm(x, y):
        """ xとyの最小公倍数を求める """
        import math
        return (x * y) // math.gcd(x, y)

    A, B = (int(i) for i in input().split())
    print(lcm(A, B))


if __name__ == '__main__':
    q3()


### FIXED CODE ###

def q3():
    def lcm(x, y):
        """ xとyの最小公倍数を求める """
        # import math
        import fractions
        return (x * y) // fractions.gcd(x, y)

    A, B = (int(i) for i in input().split())
    print(lcm(A, B))


if __name__ == '__main__':
    q3()
N=int(input())
 
li=list(map(int,input().split()))
 
ans=sorted(range(N), key=lambda a: li[a])
 
for n in range(N):
  ans[n]+=1
      
print(*ans)

### FIXED CODE ###

N=int(input())

if N%2==0:
  print(1/2)

else:
  print((N+1)/(2*N))
from collections import Counter, defaultdict, deque
import bisect
from sys import stdin, stdout
from itertools import repeat
import math
import random

# sys.stdin = open('input')

def inp():
    re = map(int, raw_input().split())
    if len(re) == 1:
        return re[0]
    return re

def inst():
    return raw_input().strip()

def gcd(x, y):
   while(y):
       x, y = y, x % y
   return x

def my_main():
        n, k, c = inp()
        st = inst()
        front, end = [], []
        def get(now, ans):
            if len(ans) == k:
                return
            for i in range(now, n):
                if st[i]=='o':
                    ans.append(i+1)
                    return get(i+1+c, ans)
        get(0, front)
        st = st[::-1]
        get(0, end)
        for i in range(len(end)):
            end[i] = n-end[i]+1
        end.sort()
        if len(front)!=k or len(end)!=k:
            return
        ans = []
        # print front, end
        for i in range(k):
            if front[i] == end[i]:
                ans.append(front[i])
        if ans:
            print '\n'.join(map(str, ans))

my_main()


### FIXED CODE ###

from collections import Counter, defaultdict, deque
import bisect
from sys import stdin, stdout
from itertools import repeat
import math
import random

# sys.stdin = open('input')

def inp():
    re = map(int, raw_input().split())
    if len(re) == 1:
        return re[0]
    return re

def inst():
    return raw_input().strip()

def gcd(x, y):
   while(y):
       x, y = y, x % y
   return x

def my_main():
        n, k, c = inp()
        st = inst()
        front, end = [], []
        def get(now, ans):
            while now < n:
                if len(ans) == k:
                    return
                for i in range(now, n):
                    if st[i]=='o':
                        ans.append(i+1)
                        now = i+c+1
                        break
                else:
                    break
        get(0, front)
        st = st[::-1]
        get(0, end)
        for i in range(len(end)):
            end[i] = n-end[i]+1
        end.sort()
        if len(front)!=k or len(end)!=k:
            return
        ans = []
        # print front, end
        for i in range(k):
            if front[i] == end[i]:
                ans.append(front[i])
        if ans:
            print '\n'.join(map(str, ans))

my_main()
k=int(input())
a,b=int(input())
if b//k-(a-1)//k>=1:
  print('OK')
else:
  print('NG')

### FIXED CODE ###

k=int(input())
a,b=map(int,input().split())
if b//k-(a-1)//k>=1:
  print('OK')
else:
  print('NG')
n = int(input())
 
max = 0
sum = 0
for i in range(n):
	data = int(input())
 	if max < data:
    	max = data
    sum = sum + data
   
print(sum - max//2)

### FIXED CODE ###

n = int(input())
max = 0
sum = 0

#print ("START")
for i in range(n):
	data = input()
#	print("aaa")
	data = int(data)
#	print(data)
	if max < data:
		max = data
	sum = sum + data
print(sum - max//2)
from copy import copy, deepcopy
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    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:  # 平方数の場合n**0.5を1つだけにしてる
                    divisors.append(n//i)

        divisors.sort(reverse=True)  # ソートしたけりゃして
        return divisors

    M = make_divisors(sum(A))

    def main():
        for i in M:
            AA = A.copy()
            age = 0
            delete = 0
            for j in range(N):
                AA[j] = AA[j] % i
                if AA[j] == 0:
                    delete += 1
                    age -= i
                age += i-AA[j]
            AA.sort()

            times = 10**9
            sage = 0
            for j in range(delete, N-1):
                sage += AA[j]
                age -= i-AA[j]
                if sage % i == age % i:
                    times = min(max(sage, age), times)
            if times <= K:
                return i
    print(main())

resolve()

### FIXED CODE ###

from copy import copy, deepcopy
# from functools import reduce
# from heapq import heapify, heappop, heappush
# from itertools import accumulate, permutations, combinations, combinations_with_replacement, groupby, product
import unittest
from io import StringIO
import math
# import numpy as np  # Pythonのみ！
# from operator import xor
# import re
# from scipy.sparse.csgraph import connected_components  # Pythonのみ！
# ↑cf.  https://note.nkmk.me/python-scipy-connected-components/
# from scipy.sparse import csr_matrix
# import string
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    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:  # 平方数の場合n**0.5を1つだけにしてる
                    divisors.append(n//i)

        divisors.sort(reverse=True)  # ソートしたけりゃして
        return divisors

    M = make_divisors(sum(A))

    def main():
        for i in M:
            AA = [0]*N
            age = 0
            # delete = 0
            for j in range(N):
                AA[j] = A[j] % i
                #if AA[j] == 0:
                    # delete += 1
                    # age -= i
                age += i-AA[j]
            AA.sort()

            times = 10**9
            sage = 0
            for j in range(0,N-1):
                sage += AA[j]
                age -= i-AA[j]
                if sage % i == age % i:
                    times = min(max(sage, age), times)
            if times <= K:
                return i
    print(main())

resolve()
N, K = map(int, input().split)
h = [int(i) for i in input().split()] 
for hantei in h:
    if K > hantei:
        N -= 1
    else:
        pass
print(N)

### FIXED CODE ###

N, K = map(int, input().split())
h = list(map(int, input().split()))
for hantei in h:
    if K > hantei:
        N -= 1
    else:
        pass
print(N)
from collections import defaultdict
import sys
from math import gcd
count = defaultdict(int)
N = int(sys.stdin.readline())

zeros = 0
for i in range(N):
    A, B = [int(x) for x in input().split()]
    if A == B == 0:
        zeros += 1
        continue
    if A == 0:
        angle = (0, 1)
    elif B == 0:
        angle = (1, 0)
    else:
        sgn = A / abs(A)
        g = gcd(A, B)
        angle = (A / sgn / g, B / sgn / g)

    count[angle] += 1


pairs = {}
solos = []
for k1 in count:
    if k1 in pairs:
        continue
    if k1 == (0, 1):
        if (1, 0) in count:
            pairs[(1, 0)] = k1
        continue

    A, B = k1
    sgn = -B / abs(B)
    k2 = (-B / sgn, A / sgn)
    if k2 in count:
        pairs[k2] = k1
    else:
        solos.append(k1)
# print(pairs, solos)

P = 1000000007


def pow2(n):
    # if n < 30:
    #     return 2 ** n

    # p = pow2(n // 2)
    # pp = (p * p) % P
    # if n % 2 == 1:
    #     return (2 * pp) % P
    # else:
    #     return pp
    return pow(2, n, P)


result = 1
for p in pairs:
    # print("pair", p, count[p], pairs[p], count[pairs[p]])
    n = count[p]
    m = count[pairs[p]]
    result = result * ((pow2(n) - 1) + (pow2(m) - 1) + 1) % P
for k in solos:
    # print("solo", k, count[k])
    result = result * pow2(count[k]) % P

print(result + zeros - 1)


### FIXED CODE ###

from collections import defaultdict
import sys
from math import gcd
count = defaultdict(int)
N = int(sys.stdin.readline())

zeros = 0
for i in range(N):
    A, B = [int(x) for x in input().split()]
    if A == B == 0:
        zeros += 1
        continue
    if A == 0:
        angle = (0, 1)
    elif B == 0:
        angle = (1, 0)
    else:
        sgn = A // abs(A)
        g = gcd(A, B)
        angle = (A // sgn // g, B // sgn // g)

    count[angle] += 1
# print(count)

pairs = {}
solos = []
for k1 in count:
    if k1 in pairs:
        continue
    if k1 == (0, 1):
        if (1, 0) in count:
            pairs[(1, 0)] = k1
        else:
            solos.append(k1)
        continue

    A, B = k1
    if B:
        sgn = -B // abs(B)
        k2 = (-B // sgn, A // sgn)
    else:
        k2 = (0, 1)
    if k2 in count:
        pairs[k2] = k1
    else:
        solos.append(k1)
#print(pairs, solos)

P = 1000000007


def pow2(n):
    # if n < 30:
    #     return 2 ** n

    # p = pow2(n // 2)
    # pp = (p * p) % P
    # if n % 2 == 1:
    #     return (2 * pp) % P
    # else:
    #     return pp
    return pow(2, n, P)


result = 1
for p in pairs:
    # print("pair", p, count[p], pairs[p], count[pairs[p]])
    n = count[p]
    m = count[pairs[p]]
    result = result * ((pow2(n) - 1) + (pow2(m) - 1) + 1) % P
for k in solos:
    # print("solo", k, count[k])
    result = result * pow2(count[k]) % P

print((result + zeros - 1) % P)
N = int(input())
A = list(int(input()) for i in range(N))
ans = A[0]
for i in range(N):
    for n in range(i):
        if ans < A[i]:
            ans = A[i]
    for n in range(i+1,N):
        if ans < A[i]:
            ans = A[i]
    print(ans)
    ans = A[0]

### FIXED CODE ###

r = int(input())
ans = r**2*3
print(ans)
import math
a, b, x = map(int, input().split())
if x >= (0.5 * a**2 * b):
    z = (math.atan(a**3/(2*(a**2*b - x))))
    print(90 - math.degrees(z))
else:
    z = (math.atan(2*x/(a * b**2)))
    print(90 - math.degrees(z))

### FIXED CODE ###

import math
a, b, x = map(int, input().split())
if x == a**2 * b:
    print(0)
else:
    if x >= (0.5 * a**2 * b):
        z = (math.atan(a**3/(2*(a**2*b - x))))
        print(90 - math.degrees(z))
    else:
        z = (math.atan(2*x/(a * b**2)))
        print(90 - math.degrees(z))
import math

k=int(raw_input())

s=k*k*math.pi
t=2*k*math.pi

print "%.6f %.6f"%(s,t)

### FIXED CODE ###

import math

k=float(raw_input())

s=k*k*math.pi
t=2*k*math.pi

print "%.6f %.6f"%(s,t)
N = int(input())
P = list(map(int, input().split()))

res = 0
for i in range(N):
    if P[i] == i + 1:
        res += 1
        P[i], P[i + 1] = P[i + 1], P[i]

print(res)


### FIXED CODE ###

N = int(input())
P = list(map(int, input().split()))

res = 0
for i in range(N):
    if P[i] == i + 1:
        res += 1
        if i < N - 1:
            P[i], P[i + 1] = P[i + 1], P[i]

print(res)
n,d = list(map(int, input.split()))

count = 0
for i in range(n):
    x,y = list(map(int, input.split()))
    if (x**2 + y**2)**0.5 <=d:
        count += 1

print(count)




### FIXED CODE ###

n,d = list(map(int, input().split()))

count = 0
for i in range(n):
    x,y = list(map(int, input().split()))
    if (x**2 + y**2)**0.5 <= d:
        count += 1

print(count)
n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [None] * n

def solve(idx):
    if idx == 0:
        return 0
    if idx == 1:
        return abs(h[0] - h[1])
    if dp[idx] is not None:
        return dp[idx]

    # dp[idx - 1] + abs(h[idx - 1] - h[idx])
    # dp[idx - 2] + abs(h[idx - 2] - h[idx])
    # ...
    # dp[idx - k] + abs(h[idx - k] - h[idx])

    ans = 10**10
    for i in range(1, k+1):
        if idx - i < 0:
            break
        prev = solve(idx - i)
        temp = prev + abs(h[idx - i] - h[idx])
        ans = min(ans, temp)

    dp[idx] = ans
    return ans

print(solve(n-1))

### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [0] * n

for i in range(n):
    if i == 0:
        dp[0] = 0
    elif i == 1:
        dp[1] = abs(h[0]-h[1])
    else:
        costs = []
        for j in range(1, k+1):
            if j > i:
                break
            if abs(h[i-j]-h[i]) == 0:
                costs.append(dp[i-j])
                break
            costs.append(dp[i-j] + abs(h[i-j]-h[i]))

        # if i == 3:
        #     print(costs)
        dp[i] = min(costs)

#print(dp)
print(dp[n-1])
a=[]
for i in range (2):
  for j in range(2):
    a.append(int(input()))
N=int(input())
for i in range(N):
  b[i]=int(input())
  
for i in range(2):
  for j in range(2):
    for k in range(N):
      if a[i][j]==b[k]:
        a[i][j]=1
      else:
        a[i][j]=0
        
if a[0][0]=1 and a[0][1]=1 and a[0][2]=1:
  print("Yes")
elif a[1][0]=1 and a[1][1]=1 and a[1][2]=1:
  print("Yes")
elif a[2][0]=1 and a[2][1]=1 and a[2][2]=1:
  print("Yes")
elif a[0][0]=1 and a[1][0]=1 and a[2][0]=1:
  print("Yes")
elif a[0][1]=1 and a[1][1]=1 and a[2][1]=1:
  print("Yes")
elif a[0][2]=1 and a[1][2]=1 and a[2][2]=1:
  print("Yes")
elif a[0][0]=1 and a[1][1]=1 and a[2][2]=1:
  print("Yes")
elif a[0][2]=1 and a[1][1]=1 and a[2][0]=1:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

A=[list(map(int,input().split())) for i in range(3)]
N=int(input())
B=list(int(input()) for i in range(N))
x=[]
for i in range(3):
  for j in range(3):
    if A[i][j] in B:
      x.append(A[i][j])
if A[0][0] in x and A[1][0] in x and A[2][0] in x:
  print("Yes")
elif A[0][1] in x and A[1][1] in x and A[2][1] in x:
  print("Yes")
elif A[0][2] in x and A[1][2] in x and A[2][2] in x:
  print("Yes")
elif A[0][0] in x and A[0][1] in x and A[0][2] in x:
  print("Yes")
elif A[1][0] in x and A[1][1] in x and A[1][2] in x:
  print("Yes")
elif A[2][0] in x and A[2][1] in x and A[2][2] in x:
  print("Yes")
elif A[0][0] in x and A[1][1] in x and A[2][2] in x:
  print("Yes")
elif A[0][2] in x and A[1][1] in x and A[2][0] in x:
  print("Yes")
else:
  print("No")
N, T = map(int, input().split())
for i in range(N):
  c, t = map(int, input().split())
  if t<=T:
    min=(c, 1001)
print('TLE' if min=1001 else c)

### FIXED CODE ###

N, T = map(int, input().split())

cost = float("inf")
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        cost = min(cost, c) 

print("TLE" if cost == float("inf") else cost)
import itertools

X,K,D = map(int,input().split())
L = [D,-D]

for comb in itertools.combinations_with_replacement(L, K):
  x = X
  for d in comb:
    x = x + d
    if(i == 0):
      x_min = x
    if(abs(x) < abs(x_min)):
      x_min = x

print(abs(x_min))
    
    


### FIXED CODE ###

a,b,c = map(str,input().rstrip(""))


if(a=="R" and b == "R" and c == "R"):
  count = 3
  
elif(a=="R" and b == "R" and c == "S"):
  count = 2
elif(a=="R" and b == "S" and c == "S"):
  count = 1
elif(a=="S" and b == "R" and c == "R"):
  count = 2
elif(a=="S" and b == "R" and c == "S"):
  count = 1
elif(a=="S" and b == "S" and c == "R"):
  count = 1
elif(a=="R" and b == "S" and c == "R"):
  count = 1
else:
  count = 0

print(count)
while(True):
    n, x = map(int, input().spilt())
    if n == 0 and x == 0:
        break
    else:
        cnt = 0
        for i in range(1, n+1):
            for k in range(i+1, n+1):
                for l in range(k+1, n+1):
                    if i + k + l == x:
                        cnt += 1
        print(cnt)


### FIXED CODE ###

while(True):
    n, x = map(int, input().split())
    if n == 0 and x == 0:
        break
    else:
        cnt = 0
        for i in range(1, n+1):
            for k in range(i+1, n+1):
                for l in range(k+1, n+1):
                    if i + k + l == x:
                        cnt += 1
        print(cnt)
N = map(int, input().split())
values = [int(input()) for _ in range(N)]
costs = [int(input()) for _ in range(N)]
# N = 3
# values = [10, 2, 5]
# costs = [6, 3, 4]
# N = 4
# values = [13, 21, 6, 19]
# costs = [11, 30, 6, 15]
# N = 1
# values = [1,]
# costs = [50,]


def calculate_maximum_gain(values, costs):
    gain = 0
    for value, cost in zip(values, costs):
        if value - cost > 0:
            gain = gain + value - cost
    
    return gain


print(calculate_maximum_gain(values, costs))


### FIXED CODE ###

N = map(int, input().split())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
# N = 3
# values = [10, 2, 5]
# costs = [6, 3, 4]
# N = 4
# values = [13, 21, 6, 19]
# costs = [11, 30, 6, 15]
# N = 1
# values = [1,]
# costs = [50,]


def calculate_maximum_gain(values, costs):
    gain = 0
    for value, cost in zip(values, costs):
        if value - cost > 0:
            gain = gain + value - cost
    
    return gain


print(calculate_maximum_gain(values, costs))
print(int(int(input())*int(input())))

### FIXED CODE ###

A, B = map(int,input().split())
print(A*B)
x, y = map(int, input().split())

while (x != 0 && y != 0):
    if x <= y :
        print(x, y)
    elif x > y :
        print(y, x)

    x, y = map(int, input().split())

### FIXED CODE ###

while 1:
    x,y = map(int,input().split())
    if not x+y:break
    if x > y : x,y = y,x
    print(x,y)
s ,w = input(). int(" ")

s=int(s)
w=int(w)

if w >= s :
  print("unsafe")
else :
  print("safe")

### FIXED CODE ###

s, w = input().split(" ")

s = int(s)
w = int(w)

if w >= s:
    print("unsafe")
else:
    print("safe")