Harryxun/stf_run huggingface dataset:
n = int,input()

integer = int(0)
v = input().split()

c = input().split()

for i in range(n):
    if int(v[i])>int(c[i]):
		integer += int(v[i])-int(c[i])
		continue
	print(integer)


### FIXED CODE ###

n = int(input())

integer = int(0)
v = input().split()

c = input().split()

for i in range(n):
	if int(v[i]) > int(c[i]):
		integer += int(v[i])-int(c[i])
print(integer)
from fractions import gcd
A,B=map(int,input().split())
print(A*B//fractions.gcd(A,B))

### FIXED CODE ###

import fractions
A,B=map(int,input().split())
print(A*B//fractions.gcd(A,B))
s = input(s)
l = ['a','b','c']
for c in s:
  l.remove(c)
print('Yes' if l ==[] else 'No')

### FIXED CODE ###

s = input()
l = ['a','b','c']
for c in s:
  if c in l:
    l.remove(c)
print('Yes' if l ==[] else 'No')
_n = int(input())
list = map(int(), input().split())
list.sort()

print(list[-1] - list[0])

### FIXED CODE ###

_n = int(input())
lists = list(map(int, input().split()))
lists.sort()

print(lists[-1] - lists[0])
from math import ceil
n, k = map(int, input().split())
val = abs(ceil(n/k)
print(min(n%k,abs(n-(k*val)),n))

### FIXED CODE ###

n, k = map(int, input().split())
val = n//k
print(min(n%k,abs(n-(k*val + k)),n))
n, k = map(int, input().split())

count = 0

for b in range(1, n + 1):
    p = n // b
    r = n % b
    count += p * max(0, b - k) + max(0, r - k + 1)

if k == 0:
    count -= n

print(count)

### FIXED CODE ###

print("".join([input()[i] for i in range(3)]))
from collections import defaultdict, deque

n, m = [int(i) for i in raw_input().split()]

# children = defaultdict(list)
parents = {}

for _ in range(m):
    u, v = [int(i) for i in raw_input().split()]
    # children[u-1].append(v-1)
    if v-1 not in parents:
        parents[v-1] = [u-1]
    else:
        parents[v-1].append(u-1)

def get_f(parents, f, i):
    if f[i] != -1:
        return f[i]

    f[i] = 0
    for v in parents[i]:
        f[i] = max(f[i], get_f(parents, f, v) + 1)

    return f[i]

def longest_path(parents, n):
    f = [-1 for _ in xrange(n)]
    # targets = [x for y in children.values() for x in y]
    # starts = [v for v in range(n) if v not in targets]

    # print f
    for i in range(n):
        get_f(parents, f, i)

    # print f
    return max(f)

# def longest_path(children, parents, n):
#     targets = [x for y in children.values() for x in y]
#     starts = [v for v in range(n) if v not in targets]
#     f = [None] * n
    
#     Q = deque([])
#     for v in starts:
#         f[v] = 0
#         Q.append((v, 0))

#     output = 0
#     while len(Q) > 0:
#         node, length = Q.pop()
#         output = max(output, length)
#         for v in children[node]:
#             Q.append((v, length+1))

#     return output

print(longest_path(parents, n))


### FIXED CODE ###

from collections import defaultdict
import sys
sys.setrecursionlimit(1000000)

n, m = [int(i) for i in raw_input().split()]
parents = defaultdict(list)

i = 0
while i < m:
    u, v = [int(x) for x in raw_input().split()]
    parents[v-1].append(u-1)
    i += 1

def calc_f(parents, f, i):
    if i < 0 or i >= len(f):
        return 0

    if f[i] != -1:
        return f[i]

    f[i] = 0
    for v in parents[i]:
        f[i] = max(f[i], calc_f(parents, f, v)+1)

    return f[i]

f = [-1] * n
j = 0
while j < n:
    calc_f(parents, f, j)
    j += 1

if len(f) == 0:
    print 0
else:
    print max(f)
import operator as op
from functools import reduce

N, K = map(int, input().split())
num_lis = list(map(int, input().split()))
num_lis = sorted(num_lis)

#組み合わせ
def combi(N,K):
  multi = op.mul
  numer = reduce(multi, range(N, N-K, -1),1)
  denom = reduce(multi, range(1,K+1), 1)
  combi = int(numer/denom)
  return combi

ans = 0
#max
for i in range(K-1,N):
  ans += num_lis[i]*combi(i, K-1)%(10**9+7)

#min
for j in range(N-K,-1,-1):
  ans -= num_lis[j]*combi(N-j-1,K-1)%(10**9+7)

print(ans)

### FIXED CODE ###

# フェルマーの小定理
N, K = map(int, input().split())
A = list(map(int, input().split()))
 
m = 1000000007
 
fac = [0] * (N + 1)
fac[0] = 1
for i in range(N):
    fac[i + 1] = fac[i] * (i + 1) % m
 
 
def mcomb(n, k):
    if n == 0 and k == 0:
        return 1
    if n < k or k < 0:
        return 0
    return fac[n] * pow(fac[n - k], m - 2, m) * pow(fac[k], m - 2, m) % m
 
 
A.sort(reverse=True)
maxX = 0
for i in range(N - K + 1):
    maxX += A[i] * mcomb(N - (i + 1), K - 1)
    maxX %= m

A.sort()
minX = 0
for i in range(N - K + 1):
    minX += A[i] * mcomb(N - (i + 1), K - 1)
    minX %= m

print((maxX - minX) % m)
import math

A, B, C = map(int, input().split())
gcd = math.gcd(A, B)

if gcd == 1 and C != 0 or gcd != 1 and math.gcd(gcd, C) != 1:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

import fractions

A, B, C = map(int, input().split())
gcd = fractions.gcd(A, B)

if gcd == 1 and C != 0 or gcd != 1 and fractions.gcd(gcd, C) != 1:
    print('YES')
else:
    print('NO')
A,B,K=map(int,input().split())
i=0
j=1
a=[]
while A%j==0 and B%j==0:
    a.append(j)
    j+=1
print(a[-K])


### FIXED CODE ###

A,B,K=map(int,input().split())
i=0
j=1
a=[]
while j<=max(A,B):
    if A%j==0 and B%j==0:
        a.append(j)
    j+=1
print(a[-K])
N=int(input())
h=list(map(int,input().split()))
s=0
mini=100
def garden(N,h,s,mini):
  p=[]
  a=0
  b=0
  size=0
  for i in range (N):
    if mini>h[i]:
      mini=h[i]
    if i!=N-1:
      if h[i]>h[i+1]:
        p.append(h[i])
        a+=h[i]
        size+=1
    if i!=N-1 and i!=0:
      if h[i]<h[i+1] and (h[i]-h[i-1])*(h[i+1]-h[i])<=0:
        p.append(h[i])
        b+=h[i]
        size+=1
    if i==N-1:
      if h[i-1]<h[i]:
        p.append(h[i])
        a+=h[i]
        size+=1
  s+=a
  s-=b
  flag=0
  for j in range (1,size-1):
    if (p[j]-p[j-1])*(p[j+1]-p[j])>0:
      flag=1
  if flag==1:
    garden(size,p,s,mini)
  if s==0:
    s+=1
  print(s)
  
garden(N,h,s,mini)

### FIXED CODE ###

N=int(input())
h=list(map(int,input().split()))
s=h[0]
for i in range (1,N):
  if h[i]>h[i-1]:
    s+=(h[i]-h[i-1])
print(s)
N = int(input())
A = list(map(int,input().split()))
A = sorted(A,reverse = False) 

B = [A[0]]
for i in range(N):
    if A[i]%A[0] != 0:
        B.append(A[i]%A[0])
B = set(B)
B = sorted(B,reverse = False) 

#import math
import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print(gcd_list(B))

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
A = sorted(A,reverse = False) 

B = [A[0]]
for i in range(N):
    if A[i]%A[0] != 0:
        B.append(A[i]%A[0])
B = set(B)
#B = sorted(B,reverse = False) 

#import math
import fractions
from functools import reduce

def gcd_list(numbers):
    #return reduce(math.gcd, numbers)
    return reduce(fractions.gcd, numbers)

print(gcd_list(B))
print(["YES","NO"][bool(len(list(multiset(map(int,input().split()))-multiset([5,5,7]))))])

### FIXED CODE ###

l=input().split();list.sort(l);print(["NO","YES"][l==["5","5","7"]])
s = input().strip()
strings = "eraser erase dreamer dream".split()
exceptions = "dreameraser dreamerase".split()
while 1:
  for string in strings:
    if s.startswith(string):
      if string == "dreamer":
        for exception in exceptions:
          if startswith(exception):
            s = s[len(exception):]
      else:
s = s[len(string):]
      break
  else:
    break
print("NO" if s else "YES")

### FIXED CODE ###

dream, erase = "dream erase".split()

s = input().strip()
while 1:
  if s.startswith(dream):
     s = s[5:]
     if s.startswith("er") and not s.startswith("era"):
       s = s[2:]
  elif s.startswith(erase):
    s = s[5:]
    if s.startswith('r'):
      s = s[1:]
  else:
    break
print("NO" if s else "YES")
s=input()
print(["vowel","consonant"][s="a" or s="i" or s="u" or s="e" or s="o"])


### FIXED CODE ###

s=input()
print(["consonant","vowel"][s=="a" or s=="i" or s=="u" or s=="e" or s=="o"])
ｔd,n = map(int,input().split())
print(n*100**d)

### FIXED CODE ###

d,n = map(int,input().split())
print(n*100**d if n < 100 else 101*100**d)
N = int(input())

import sympy
ans = 0
for i in range(1,N+1):
    ans +=  i*len(sympy.divisors(i))

print(ans)

### FIXED CODE ###

def solve(n):
    ans=0
    for d in range(1,n+1):
        c=n//d
        ans+=(c+1)*c//2*d
    return ans
 
n=int(input())
print(solve(n))
import sys
from collections import Counter
input = sys.stdin.readline
N = int(input())
xy = [tuple([int(i) for i in input().split()]) for _ in range(N)]
ary = []
for i, t in enumerate(xy[:-1]):
    x = t[0]
    y = t[1]
    for x2, y2 in xy[i+1:]:
        p = x2-x
        q = y2-y
        ary.append((p, q))
c = dict(Counter(ary))
print(N-max(c.values()))


### FIXED CODE ###

import sys
from collections import Counter
input = sys.stdin.readline
N = int(input())
xy = [tuple([int(i) for i in input().split()]) for _ in range(N)]
ary = []
if N == 1:
    print(1)
    exit()
for i, t in enumerate(xy[:-1]):
    x = t[0]
    y = t[1]
    for x2, y2 in xy[i+1:]:
        ary.append((x2-x, y2-y))
        ary.append((x-x2, y-y2))
c = dict(Counter(ary))
print(N-max(c.values()))
import copy
n,t = map(int,input().split())
ab = [[int(i) for i in input().split()] for j in range(n)]

dp = [[0 for i in range(t)] for j in range(n+1)]
li = [[[] for i in range(t)] for j in range(n+1)]

for i in range(n):
    for j in range(t):
        dp[i+1][j] = dp[i][j]
        li[i+1][j] = li[i][j]
        #print(j,ab[i][0])
        if j < ab[i][0]:
            continue
        if dp[i][j] < dp[i][j-ab[i][0]] + ab[i][1]:
            dp[i+1][j] = dp[i][j-ab[i][0]] + ab[i][1]
            li[i+1][j].append(i)
        #dp[i+1][j] = max(dp[i][j],dp[i][j-ab[i][0]] + ab[i][1])

abcopy = copy.deepcopy(ab)
abcopy.sort()

plus = 0
for i in range(n):
    if i in li:
        continue
    else:
        plus = abcopy[i][0]

print(dp[n][t]+plus)


### FIXED CODE ###

n,t = map(int,input().split())
ab = [[int(i) for i in input().split()] for j in range(n)]

dp = [[0 for i in range(t)] for j in range(n+1)]
ab.sort()

ans = 0

for i in range(n):
    for j in range(t):
        #for k in range(2):
        #dp[i+1][j] = max(dp[i][j],dp[i-1][j])
        dp[i+1][j] = dp[i][j]
        #print(j,ab[i][0])
        if j >= ab[i][0]:
        #if dp[i][j] < dp[i][j-ab[i][0]] + ab[i][1]:
        #    dp[i+1][j] = dp[i][j-ab[i][0]] + ab[i][1]
            dp[i+1][j] = max(dp[i][j],dp[i][j-ab[i][0]] + ab[i][1])
        #print(dp)
    #print(h,dp)

#print(ab)
#print(dp)


max_num = [0]*n

for i in reversed(range(n)):
    #print(i)
    if i == 0:
        break
    if max_num[i] < ab[i][1]:
        max_num[i-1] = ab[i][1]
    else:
        max_num[i-1] = max_num[i]

#print(max_num)
#print(ab[2272:2336])
#exit()

ans = 0
for i in range(n-1):
    #print(i)
    if ans < dp[i+1][t-1]+max_num[i]:
        ans = dp[i+1][t-1]+max_num[i]
        #print(i,ans,max_num[i],max_num[i+1],max_num[i-1])
    #ans = max(ans,)
    #print(max(ab[i:][1]))
    #print()
        
print(ans)
#print())
import sys
N,K = map(int,input().split())
lsx = list(map(int,input().split()))
if 0 in lsx:
    K = K-1
    lsx.remove(0)
if bool(lsx) == False or K == 0:
    print(0)
    sys.exit()
lshu = []
for i in range(N):
    if lsx[i] < 0:
        lshu.append(lsx[i])
    else:
        sei = i
        break
lssei = lsx[sei:]
lenhu = len(lshu)
lensei = len(lssei)
lshu2 = [abs(lshu[i]) for i in range(lenhu-1,-1,-1)]
dishu = [0] + lshu2
dissei = [0] + lssei
ans = 10*10**8
for i in range(K):
    if i <= lenhu and K-i <= lensei:
        ans = min(ans,2*dishu[i]+dissei[K-i],dishu[i]+2*dissei[K-i])
print(ans)

### FIXED CODE ###

import sys
N,K = map(int,input().split())
lsx = list(map(int,input().split()))
if 0 in lsx:
    K = K-1
    lsx.remove(0)
if bool(lsx) == False or K == 0:
    print(0)
    sys.exit()
lshu = []
sei = len(lsx)
for i in range(len(lsx)):
    if lsx[i] < 0:
        lshu.append(lsx[i])
    else:
        sei = i
        break
lssei = lsx[sei:]
lenhu = len(lshu)
lensei = len(lssei)
lshu2 = [abs(lshu[i]) for i in range(lenhu-1,-1,-1)]
dishu = [0] + lshu2
dissei = [0] + lssei
ans = 10*10**8
for i in range(K+1):
    if i <= lenhu and K-i <= lensei:
        ans = min(ans,2*dishu[i]+dissei[K-i],dishu[i]+2*dissei[K-i])
print(ans)
n, k = [int(i) for i in input().split()]
r, s, p = [int(i) for i in input().split()]
t = list(input())
ans = 0
dic = {'p': s, 's': r, 'r': p}
for i in range(k):
  ans += dic[t[i]]
dic_ls = []
for i in range(k, n):
  if t[i] != t[i - k]:
    ans += dic[t[i]]
  else:
    t[i] = 'j'
print(ans)

### FIXED CODE ###

s, t = input().split()
print("".join([t, s]))
def cmb(n, r, p):
	if (r < 0) or (n < r):
		return 0
	r = min(r, n - r)
	return fact[n] * factinv[r] * factinv[n - r] % p


p = 10 ** 9 + 7
N = 10 ** 6  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
	fact.append((fact[-1] * i) % p)
	inv.append((-inv[p % i] * (p // i)) % p)
	factinv.append((factinv[-1] * inv[-1]) % p)


n,a,b=map(int,input().split())
ans=((2**n-1)%p-cmb(n,a,p)-cmb(n,b,p))
print(0 if ans<0 else ans)


### FIXED CODE ###

mod=10**9+7
n,a,b=map(int,input().split())
ans=pow(2,n,mod)-1 #n種類の花を使って花束を作る総数は2^n-1通り
comb1=1 #nCaの計算
for i in range(n-a+1,n+1): #n*(n-1)*…*(n-a+1)を計算
 comb1*=i
 comb1%=mod
for i in range(1,a+1): #1/a!=1/(1*2*…*a)=1^(p-2)*2^(p-2)*…*a^(p-2) (p=10**9+7)を計算
 comb1*=pow(i,mod-2,mod)
 comb1%=mod
comb2=1
for i in range(n-b+1,n+1): #n*(n-1)*…*(n-b+1)を計算
 comb2*=i
 comb2%=mod
for i in range(1,b+1): #1/b!=1/(1*2*…*b)=1^(p-2)*2^(p-2)*…*b^(p-2) (p=10**9+7)を計算
 comb2*=pow(i,mod-2,mod)
 comb2%=mod
ans-=(comb1+comb2) #nCa、nCbを総数から引く
ans%=mod
print(ans)
N = int(input())
ans = 0
for i in range(N):
	val, currency = input().split()
    if currency == 'JPY':
      ans += float(val)
    else:
      ans += float(val) * 380000.0
print(ans)


### FIXED CODE ###

N = int(input())
ans = 0
for i in range(N):
  val, currency = input().split()
  if currency == 'JPY':
    ans += float(val)
  else:
    ans += float(val) * 380000.0
print(ans)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
C.sort()
ans = 0
for b in B:
    a_max = bisect.bisect_left(A, b)
    c_min = bisect.bisect_right(C, b)
    ans += a_max * (N - c_min)
print(ans)

### FIXED CODE ###

import bisect
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort()
C.sort()
ans = 0
for b in B:
    a_max = bisect.bisect_left(A, b)
    c_min = bisect.bisect_right(C, b)
    ans += a_max * (N - c_min)
print(ans)
import collection
N = int(input())
A = list(map(int, input().split()))
count = collections.Counter(A)
for n in range(N):
  print(count[n + 1])
  

### FIXED CODE ###

import collections
N = int(input())
A = list(map(int, input().split()))
count = collections.Counter(A)
for n in range(N):
  print(count[n+1])
import collections
import bisect
n,m = map(int,input().split())
p = [list(map(int,input().splilt())) for i in range(m)]
a = collections.defaultdict(list)
for x,y in sorted(p):
  a[x]+=[y]
for x,y in p:
  z = bisect.bisect(a[x],y)
  print("%06d%06d"%(x,z))

### FIXED CODE ###

import collections
import bisect
n,m=map(int,input().split())
p=[[int(j) for j in input().split()] for i in range(m)]
a=collections.defaultdict(list)
for x,y in sorted(p):
    a[x]+=[y]
for x,y in p:
    z=bisect.bisect(a[x],y)
    print("%06d%06d"%(x,z))
import sys
input = sys.stdin.readline

N = int(input())
T_N = [int(input()) for _ in range(N)]
M = int(input())
for _ in range(M):
    P_M, X_M = map(int, input().split())

sumT = sum(T_N)
for idx1 in range(M):
    print(sumT - T_N[P_M[idx1] - 1] + X_M[idx1])


### FIXED CODE ###

import sys
in1 = sys.stdin.readlines()

#in1 = ['5','7 2 3 8 5','3','4 2','1 7','4 13']

N = int(in1[0])
T_N = list(map(int, in1[1].split()))
M = int(in1[2])
P_M = [None] * M
X_M = [None] * M
idx1 = 0
for PX in in1[3:]:
    P_M[idx1], X_M[idx1] = map(int, PX.split())
    idx1 += 1

sumT = sum(T_N)
for idx1 in range(M):
    print(sumT - T_N[P_M[idx1] - 1] + X_M[idx1])
a = int(input())
b = int(input())
c = int(input())
d = int(input())

if abs(a - c) <= d:
    print('Yes')
elif (a < b and b < c) or (a > b and b > c) :
    if abs(a - b) <= d and abs(b - c) <= d:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

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

if abs(a - c) <= d:
    print('Yes')
elif (a < b and b < c) or (a > b and b > c):
    if abs(a - b) <= d and abs(b - c) <= d:
        print('Yes')
    else:
        print('No')
else:
    print('No')
n = int(input())
A = int(input())
B = int(input())
print("Hello World" if n==1 else A + B)

### FIXED CODE ###

n = int(input())
if n == 1:
  print("Hello World")
else:
  a = int(input())
  b = int(input())
  print(a+b)
import sys


for line in sys.stdin:
    xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2 = map(float, line.rstrip('\n').split(' '))
    if ((xb1<=xa1 and xa1<=xb2) or (xa1<=xb1 and xb1<=xa2)) and ((yb1<=ya2 and ya2<=yb2) or (ya1<=yb2 and yb2<=ya2)):
        print 'YES'
    else:
        print 'NO'

### FIXED CODE ###


import sys


for line in sys.stdin:
    xa1, ya1, xa2, ya2, xb1, yb1, xb2, yb2 = map(float, line.strip().split(' '))
    if ((xb1<=xa1 and xa1<=xb2) or (xa1<=xb1 and xb1<=xa2)) and ((yb1<=ya2 and ya2<=yb2) or (ya1<=yb2 and yb2<=ya2)):
        print 'YES'
    else:
        print 'NO'
N = int(input()) # 数字を変数に格納
List = list(map(int,input().split())) # 複数の数字をリストに格納

List.sort()

for i in range(N-1):
    if List[i] == List[i+1]:
        result = 'NO'
        break
        
print(result)

### FIXED CODE ###

N = int(input()) # 数字を変数に格納
List = list(map(int,input().split())) # 複数の数字をリストに格納

List.sort()
result = 'YES'

for i in range(N-1):
    if List[i] == List[i+1]:
        result = 'NO'
        break
        
print(result)
(r,c) = [int(i) for i in input().split()]

table = []
for rc in range(r):
    table.append([int(i) for i in input().split()])

table.append([0 for  _  in range(c + 1)])

for rc in range(r):
    row_total = 0
    for cc in range(c):
        table[r][cc] += table[rc][cc]
        row_total += table[rc][cc]

    table[rc].append(row_total)
    table[r][c] += row_total

for row in table:
   print(' '.join([str(column) for column in row]))

    print()

### FIXED CODE ###

(r, c) = [int(i) for i in input().split()]
last_row = [0 for _ in range(c+1)]
 
for _ in range(r):
    row = [int(i) for i in input().split()]
    for cc in range(c):
        last_row[cc] += int(row[cc])
        print(row[cc], end=' ')
 
    print(sum(row))
 
last_row[-1] = sum(last_row)
print(' '.join([str(a) for a in last_row]))
# -*- coding: utf-8 -*-
x, N = map(int, input().split())

if N != 0:
    num_list = list(map(int, input().split()))

min_abs = 100
min_num = 0

for num in range(1, 101):
    if not num_list:
        min_num = x
        break
    if num in num_list:
        continue
    else:
        b = abs(num-x)
        if b < min_abs:
            min_abs = b
            min_num = num
            
print(min_num)

### FIXED CODE ###

# -*- coding: utf-8 -*-
x, N = map(int, input().split())

num_list = list(map(int, input().split()))

i = 0            
while True:
    a = x - i
    b = x +i
    if not a in num_list:
        min_num = a
        break
    elif not b in num_list:
        min_num = b
        break
    else:
        i += 1
            
print(min_num)
import math

n, m = map(int, input().split())
a = list(map(int, input().split()))

def f(x):
    res = 0
    while x % 2 == 0:
        x/= 2
        res += 1
    return res

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

for i in range(n):
    a[i] //= 2

t = f(a[0])

ans = 0
for i in range(n):
    if f(a[i] != t):
        print(0)
        exit()
    a[i] >>= t

m >>= t

l = 1
for i in range(n):
    l = lcm(l, a[i])
    if l > m:
        print(0)
        exit()

m //= l
ans = (m + 1)//2
print(ans)


### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))

def f(x):
    res = 0
    while x % 2 == 0:
        x//= 2
        res += 1
    return res

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

for i in range(n):
    a[i] //= 2

t = f(a[0])

ans = 0
for i in range(n):
    if f(a[i]) != t:
        print(0)
        exit()
    a[i] >>= t

m >>= t

l = 1
for i in range(n):
    l = lcm(l, a[i])
    if l > m:
        print(0)
        exit()

m //= l
ans = (m + 1)//2
print(ans)
N, M = 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:
                divisors.append(n//i)
                
    return divisors

div = sorted(make_divisors(M))

i = 0
while i<=len(div) and M//div[i]>=N:
    ans = div[i]
    i+=1
    
print(ans)

### FIXED CODE ###

N, M = 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:
                divisors.append(n//i)
                
    return divisors

if N==1:
    print(M)

else:
    div = sorted(make_divisors(M))
    i = 0 
    while i<=len(div) and M//div[i]>=N:
        ans = div[i]
        i+=1
    print(ans)
n = int(input())
l = list(map(int.input().split()))
l.sort()
print(abs(l[0]-l[len(l)-1]))

### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
l.sort()
print(abs(l[0]-l[len(l)-1]))
import math

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

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

llcm=1
for i in range(n):
    llcm= lcm(llcm,l[i])

mmax=llcm
fmmax=0
for m in range(mmax):
    fm=0
    for i in l:
        fm += m%i
    if fm > fmmax:
        fmmax=fm
print(fmmax)

### FIXED CODE ###

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

cnt=0
f=0
for i in l:
    f += i-1
print(f)
import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

nums=[]

num=0
pow10=1
for i in range(1000):
    num+=pow10
    if num>10**15: break
    if i%9==8: pow10*=10
    nums.append(num)

k=int(input())
for i in range(k):
    print(nums[i])


### FIXED CODE ###


import sys
#sys.stdin=open("data.txt")
input=sys.stdin.readline

nums=[]

num=0
pow10=1

# add a few possible answers
for i in range(16):
    t="9"*i
    if t!="": nums.append(int(t))
    for j in range(1,1000):
        t=str(j)+"9"*i
        if len(t)>15: continue
        nums.append(int(t))

def dsum(x):
    t=0
    while x:
        t+=x%10
        x//=10
    return t

# remove some bad numbers
out=[]
rat=[]
for i in sorted(set(nums)):
    j=i/dsum(i)
    while rat and rat[-1]>j:
        out.pop(-1)
        rat.pop(-1)
    out.append(i)
    rat.append(j)

#print(len(out))

#for i in range(len(out)): print(i,out[i],rat[i])

#for i in range(len(nums)):
#    print(i,dsum(nums[i]),nums[i]/dsum(nums[i]))

k=int(input())
for i in range(k):
    print(out[i])
N = int(input())
S = input()
K = int(input())

compare_str = S[K - 1]
result_str = ''
for s in list(S):
    if compare_str == s:
	result_str += s
    else:
	result_str += '*'
print(result_str)

### FIXED CODE ###

N = int(input())
S = input()
K = int(input())

compare_str = S[K - 1]
result_str = ''
for s in list(S):
  if compare_str == s:
    result_str += s
  else:
    result_str += '*'
print(result_str)
from fractions import gcd

n = int(input())
a = [int(i) for i in input().split()]
l,r,ans = [a[0]],[a[-1]],[gcd(a[0],a[-1])]
if len(a) == 2:
    print(gcd(a[0],a[1]))
    exit()
for i in range(1,n//2+1):
    l.append(gcd(a[i-1],a[i]))
    r.append(gcd(a[n-i],a[n-i-1]))
    ans.append(r[-1])
    ans.append(l[-1])
ans = list(set(ans))
print(ans[1])


### FIXED CODE ###

from fractions import gcd

n = int(input())
a = [int(i) for i in input().split()]
l,r = [0],[0]
for i in range(1,n):
    l.append(gcd(l[i-1],a[i-1]))
    r.append(gcd(r[i-1],a[-i]))
r = r[::-1]
ans = 0

for i in range(n):
    ans = max(ans,gcd(l[i],r[i]))
print(ans)
X,K,D = list(map(int,input_[0].split()))

N = abs(X)//D

if N >= K:
    ans = abs(X) - K*D
elif (K-N)%2 == 0:
    ans = abs(X) - N*D
else:
    ans = D - (abs(X) - N*D)
print(ans)

### FIXED CODE ###

X,K,D = list(map(int,input().split()))

N = abs(X)//D

if N >= K:
    ans = abs(X) - K*D
elif (K-N)%2 == 0:
    ans = abs(X) - N*D
else:
    ans = D - (abs(X) - N*D)
print(ans)