peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
a,b,c = map(int, input().split())
if (a+b+c)%3==0: print('Yes')
else: print('No')
# Judge status: Accepted
#D
N = int(input())
A = list(map(int, input().split()))
A.append(0)

cash = 1000
stock = 0
for i in range(N):
    if A[i] < A[i+1]:
        stock += cash // A[i]
        cash = cash % A[i]
    else:
        cash += stock * A[i]
        stock = 0

print(cash)
# Judge status: Wrong Answer
N,P = map(int,input().split())
A = list(map(int,input().split()))
n0=0
n1=0
for i in range(N):
    if A[i]%2==0:
        n0 += 1
n1 = N-n0
if n1==0:
    if P==0:
        print(2**n0-1)
    else:
        print(0)
elif P==0:
    print(2**(n1-1)*2**n0-1)
elif P==1:
    print(2**(n1-1)*2**n0)
# Judge status: Accepted
n,a,b=map(int,input().split())
ans=[0]*37
def ssum(n):
  li=list(str(n))
  ret=0
  for i in li:
    ret+=int(i)
  return(ret)
  
while n!=0:
  ans[ssum(n)]+=n
  n-=1

print(sum(ans[a:b+1]))
# Judge status: Accepted
N, M = map(int, input().split())
AB = []
for i in range(N):
  AB.append(list(map(int, input().split())))
AB = sorted(AB, key=lambda x:x[0])

cost, num, want = 0, M, M
for i in range(N):
  num = min(want, AB[i][1])
  cost += AB[i][0] * num
  want -= num
  if num == 0:
    break
print(cost)
# Judge status: Wrong Answer
n = int(input())
h = list(map(int,input().split()))
count_m = 0
for i in range(n):
    s = h[i]
    count = 0
    for j in range(i+1,n):
        if s >= h[j]:
            count += 1
            s = h[j]
    count_m = max(count_m, count)
print(count_m)
# Judge status: Accepted
N, L = map(int,input().split())

l = 0
m = 10000
for i in range(1,N+1):
  l += L+i-1
  m = min(m,abs(L+i-1))
if L+N-1 >= 0:
  l -= m
else:
  l += m
print(l)
# Judge status: Accepted
def resolve():
    N, Y = map(int, input().split())

    for x in range(N+1):
        for y in range(N+1-x):
            _sum = 10000 * x + 5000 * y + 1000 * (N-x-y)
            if _sum == Y:
                print(x, y, N-x-y)
                exit(0)

    print(-1, -1, -1)


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
N, Q = map(int, input().split())
S = input()
acList = [0 for n in range(N+1)]
for i in range(N):
    if("AC" == S[i:i+2]):
        acList[i+1] += acList[i] + 1
    else:
        acList[i+1] += acList[i]
for q in range(Q):
    left, right = map(int, input().split())
    print (acList[right-1] - acList[left-1])
# Judge status: Accepted
n = int(input())
s = input()

r = s.count('R')
g = s.count('G')
b = s.count('B')
cnt = 0
for j in range(n-2):
  sj = s[j]
  for i in range(1, (n-j)//2+1):
    if n <= j+2*i:
      break
    sd = s[j+i]
    sd2 = s[j+2*i]
    if (sj != sd) and (sj != sd2) and (sd != sd2):
      cnt += 1
print(r*g*b - cnt)
# Judge status: Accepted
n, k = [int(i) for i in input().split(" ")]
h = [int(i) for i in input().split(" ")]

dp = [float("inf")] * n
dp[0] = 0

for i in range(len(h)):
  for j in range(1, k+1, 1):
    if (i+j) < len(h):
      dp[i+j] = min(dp[i+j], dp[i]+abs(h[i+j] - h[i]))
print(dp[-1])
# Judge status: Accepted
S = input()
n = len(S)
t = len(set(list(S)))
if n == t:
    print('yes')
else:
    print('no')
# Judge status: Accepted
N=input()

if N[0]=='9' or N[1] == '9':
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a, b = map(int, input().split())
print("Yay!" if a<=8 and b<=8 else ":(")
# Judge status: Accepted
n = int(input())
n = str(n)
if "9" in n:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#!/usr/bin/env python3
import collections
import itertools as it
import math
import numpy as np
import functools
 
#  = input()
n  = int(input())
#  = map(int, input().split())
#  = list(map(int, input().split()))
t  = [int(input()) for i in range(n)]
#
# c = collections.Counter()

def euclid(a, b):
    if b == 0:
        return a
    else:
        return euclid(b, a%b)

def multiple(a, b):
    return a*b // euclid(a, b)

def gcd(nums):
    return functools.reduce(euclid, nums)

def lcm(nums):
        return functools.reduce(multiple, nums)

print(lcm(t))
# Judge status: Accepted
abc = sorted(list(map(int, input().split())))
k = int(input())

for i in range(k):
    abc[2] *= 2

print(sum(abc))
# Judge status: Wrong Answer
import math
c= 0
n = int(raw_input())
while(n and n % 2 == 0):
    n/=2
    c+=1
print c
# Judge status: Accepted
N = int(input())

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

A=[-1 for x in range(N)]
i=0
j=0
for a in B:
  j=i+1
  if A[i]==-1:
    A[i]=a
    A[j]=a
  else:
    if A[i]>a:
      A[i]=a
    A[j]=a
  i=i+1
  #print(A)
total = 0
for num in A:
  total = total + num
print(total)
# Judge status: Accepted
import sys

def solve():
    input = sys.stdin.readline
    N, A, B = map(int, input().split())
    if A > B: print(0)
    elif N == 1:
        if B != A: print(0)
        else: print(1)
    else:
        rem = N - 2
        minS = A + B + rem * A
        maxS = A + B + rem * B
        print(maxS - minS + 1)

    return 0

if __name__ == "__main__":
    solve()
# Judge status: Wrong Answer
A,B,C,X,Y=map(int,input().split())
ans=5000*(10**5)+1

for i in range(max(X,Y)+1):
  total=0
  total=2*C*i+A*max(X-i,0)+B*max(Y-i,0)
  ans=min(total,ans)
print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline

H,N = map(int, input().split())
table = []
dp = [10**9]*(H+1)
dp[0] = 0

for i in range(N):
    a,b = map(int, input().split())
    table.append((a,b))

for i in range(1,H+1):
#    print(dp)
    for j in range(N):
        a,b = table[j]
        if i<a:
            dp[i] = min(dp[i],b)
        else:
            dp[i] = min(dp[i],dp[i-a]+b)
print(dp[-1])
# Judge status: Accepted
N = int(input())
A = [int(x) for x in input().split()]
B = []
for i in A:
  if i%2 == 0:
    B.append(i)
count = 0
for j in B:
  if j%3 == 0 or j%5 == 0:
    count = count + 1
if count >= len(B):
  print("APPROVED")
else:
  print("DENIED")
# Judge status: Accepted
n = int(input())
li = [[0]*n for i in range(26)]
for i in range(n):
    S = list(input())
    for x in S:
        li[ord(x)-97][i] += 1
ans = []
for i in range(26):
    num = min(li[i])
    ans += [chr(i+97)] * num
print(''.join(ans))
# Judge status: Wrong Answer
a,b=map(int,input().split())
print(a*b*2/2)
# Judge status: Wrong Answer
N = int(input())
a=360/N
print(int(a))
b=isinstance(a, float)
text_a = str(b)
text_b =float
c=text_a == text_b
if c!=False:
    print(int(a+1))
# Judge status: Accepted
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())

X,Y = MI()
print(X + Y//2)
# Judge status: Accepted
# -*- coding: utf-8 -*-
 
a = list(map(int,input().split()))

A, B, C, K = a[0], a[1], a[2], a[3]

if ( K <= A ):
  print(K)
elif ( K <= A+B ):
  print(A)
elif ( K <= A+B+C ):
  print(2*A+B-K)
else:
  print(A-C)
# Judge status: Wrong Answer
n = int(input())
a = n//1.08
print(int(a+1))
# Judge status: Accepted
import collections
n = int(input())
a = list(map(int,input().split()))
aa  = collections.Counter(a)
aakey = list(aa.keys())     
aavalue = list(aa.values())     
ans = 0
for i in range(len(aavalue)):
         ans += (aavalue[i] * (aavalue[i] - 1))//2
for i in range(n):
         val = aa[a[i]]
         print(ans-(val-1))
# Judge status: Wrong Answer
from collections import deque

k = int(input())

que = deque([1,2,3,4,5,6,7,8,9])

for n in range(0, k):
  x = que.popleft()
  if x % 10 != 0:
    que.append(x * 10 + x % 10 - 1)
  que.append(10*x)
  if x % 10 != 9:
    que.append(x * 10 + x % 10 + 1)

print(x)
# Judge status: Accepted
s = int(input())
MOD = 10 ** 9 + 7
ans = 0
fact = [0] * 10000
fact[0], fact[1] = 1, 1
for i in range(2, 10000):
    fact[i] = (fact[i-1] * i) % MOD

def f(n, r):
    return fact[n] * pow(fact[n-r], -1, MOD) * pow(fact[r], -1, MOD)

for i in range(1, s//3+1):
    if i == 1:
        ans += 1
    else:
        m = s - i * 3
        ans += f(m+i-1, m)
        ans %= MOD
print(ans%MOD)
# Judge status: Wrong Answer
n = int(input())
l1 = 2
l2 = 1
l3 = l2 + l1

for i in range(n - 2):
    l1 = l2
    l2 = l3
    l3 = l2 + l1


print(l3)
# Judge status: Accepted
n, m = map(int,input().split())

if n * m == 1:
    print(1)
    exit()

if n > 1 and m > 1:
    temp = 2 * (n + m) - 4
    ans = n * m - temp
    print(ans)
else:
    print(n * m - 2)
# Judge status: Accepted
from collections import deque

k=int(input())

lunlun=deque(i for i in range(1,10))
for _ in range(k-1):
  p=lunlun.popleft()
  if p%10!=0:
    lunlun.append(10*p+p%10-1)
  lunlun.append(10*p+p%10)
  if p%10!=9:
    lunlun.append(10*p+p%10+1)
print(lunlun.popleft())
# Judge status: Wrong Answer
import sys
import collections
import itertools
import numpy as np

n,m = map(int, input().split())
al = np.ones(n,dtype="int8")
H = list(map(int, input().split()))
AB=[]

for i in range(m):
    AB.append(tuple(map(int, input().split())))

for t in range(m):
    A = AB[t][0]
    B = AB[t][1]
	
    bou1 = H[A-1]
    bou2 = H[B-1]
    if bou1<bou2:
        al[A-1] = al[A-1]-1
    elif bou2<bou1:
        al[B-1] = al[B-1]-1

print(np.count_nonzero(al>0))
# Judge status: Accepted
N,M = map(int,input().split())

# 約数列挙
def enum_div(N):
    ret = []
    i = 1
    while True:
        if i**2 > N:
            break
        if N % i == 0:
            ret.append(i)
            if i**2 != N:
                ret.append(N / i)
        i += 1
    return ret

ans = 0
for i in enum_div(M):
    if i >= N:
        ans = max(ans,M / i)

print(int(ans))
# Judge status: Wrong Answer
n = int(input())
sol = 0
for x in range(1, n+1):
  if x%3 != 0 and x%5 != 0:
    sol += x
print(x)
# Judge status: Wrong Answer
x = [list(map(int,input().split())) for i in range(3)]
m=0
for i in range(3):
    m+=sum(x[i])
if m%3 == 0 and (x[0][0]+x[1][1]+x[2][2])%3==0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
S = input()

ans = S[1:].count("E")

for i in range(N-1):
    count = ans
    if S[i] == "W":
        count += 1
    if S[i+1] == "E":
        count -= 1
    ans = min(count,ans)
print(ans)
# Judge status: Wrong Answer
N,A,B = map(int,input().split())
if A>B:
  print(0)
elif N == 1:
  print(0)
elif A==B:
  print(1)
else:
  ans = 0
  C = (B-A+1)
  for i in range(N-2):
    ans += C
    C -= 1
  print(ans)
# Judge status: Accepted
n = int(input())
w=list(map(int, input().split()))
ans = 10**4
for i in range(n):
    x = abs(sum(w[:i+1]) - sum(w[i+1:n]))
    ans = min(ans,x)
print(ans)
# Judge status: Accepted
N,A,B=map(int,input().split())
S=list(input())
a,b=0,0
for i in S:
    if i == "a" and a < A+B:
        a += 1
        print("Yes")
    elif i == "b" and a < A+B and b < B:
        a += 1
        b += 1
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
n, m = map(int, input().split())
ss = list()
cs = list()
for i in range(m):
    s, c = map(int, input().split())
    ss.append(s)
    cs.append(c)

if n != 1:
    data_range = range(10 ** (n - 1), 10 ** n)
else:
    data_range = range(0, 10)


def is_ok(i):
    for s, c in zip(ss, cs):
        if int(str(i)[s - 1]) != c:
            return False
    return True

for i in data_range:
    if is_ok(i):
        print(i)
        break
else:
    print('-1')
# Judge status: Accepted
N = int(input())

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

ans = 0
N //= 2
while N :
    ans += N//5
    N //= 5

print(ans)
# Judge status: Accepted
n = int(input())
alp = "abcdefghijklmnopqrstuvwxyz"
def solve(n):
    if n<26:
        return [alp[n]]

    ans=[alp[(n%26)]]

    ans.extend(solve((n//26)-1))
    return ans


ans=solve(n-1)
ans.reverse()
print(*ans,sep="")
# Judge status: Wrong Answer
import sys

N, M = map(int, input().split())
A = []

for m in range(M):
  if m == 0:
    A.append(int(input()))
    continue

  i = int(input())
  if A[-1] == i-1:
    print(0)
    sys.exit()

  A.append(i)

li = [0] * (N+1)
li[0] = 1

for n in range(1, N+1):
  if n in A or n == 1:
    continue

  li[n] = li[n-1] + li[n-2]

print(li[-1] % (10**9 + 7))
# Judge status: Accepted
n = int(input())
ans = 100000000000000
for i in range(1, 1000001):
  if n % i == 0:
    a = i - 1
    b = n // i - 1
    ans = min(ans, a + b)
print(ans)
# Judge status: Wrong Answer
import heapq
n,m = map(int,input().split())
arr= list(map(lambda x: int(x)*(-1) ,input().split()))
heapq.heapify(arr)
for i in range(m):
    d = heapq.heappop(arr)
    heapq.heappush(arr,d//2)
print(sum(arr)*-1)
# Judge status: Accepted
N,M = map(int, input().split())
A = list(map(int, input().split()))

print(max(-1, N - sum(A)))
# Judge status: Accepted
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = [str(input()) for _ in range(5)]

n = 10
cnt = 0

for i in range(len(a)):
	if int(a[i][-1]) < n and int(a[i][-1]) != 0 :
		n = int(a[i][-1])
		cnt = i

for i in range(len(a)):
	if i == cnt:
		a[i] = int(a[i])
	elif int(a[i][-1]) == 0:
		a[i] = int(a[i])
	else:
		a[i] = (int(a[i])//10 + 1)*10

print(sum(a))
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
ans = [0,0,0]
for i in l:
  if i % 4 == 0:
    ans[0] += 1
  elif i % 2 == 0:
    ans[1] += 1
  else:
    ans[2] += 1
    
if ans[0] >= ans[2]:
  print("Yes")
elif ans[1] == 0 and ans[0]+1 == ans[2]:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n=int(input())
ans=1000
lst_1=list(map(int,input().split()))
# print(lst_1)
for i in range(n-1):
    if (lst_1[i]<lst_1[i+1]):
        k=ans//lst_1[i]
        ans+=(lst_1[i+1]-lst_1[i])*k
print(ans)
# Judge status: Accepted
import math
import sys
input = sys.stdin.readline

s = input().strip()
ans = []
for i in s:
	if i == '?':
		ans.append('D')
	else:
		ans.append(i)
print(''.join(ans))
# Judge status: Accepted
s = input()
t = input()

ss = s+s

f = 0
for i in range(len(s)):
#    print(s[i:len(s)+i])
    if ss[i:len(s)+i] == t:
        f = 1


if f:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
o = input()
e = input()

for i in range(min(len(o), len(e))):
    print(o[i], end="")
    print(e[i], end="")

if len(o) > i+1:
    print(o[-1])
elif len(e) > i+1:
    print(e[-1])
# Judge status: Wrong Answer
#整数の入力
N = int(input())

ans = 1


for i in range(N):
  ans = ans * ((i+1)%(10**9 + 7))
  

print(ans)
# Judge status: Wrong Answer
N = int(input())
v = list(map(int,input().split()))
v.sort()

while len(v) >= 2:
    if len(v) % 2 == 0:
        newv = [(v[i] + v[i+1])/2 for i in range(0,len(v)-1,2)]
        v = newv
    else:
        f = v[len(v)-1]        
        newv = [(v[i] + v[i+1])/2 for i in range(0,len(v)-2,2)]
        v = newv
        v.append(f)

if len(v) == 1:
    print(v[0])
# Judge status: Accepted
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n, a, b = map(int, input().split())
if abs(a - b) % 2 == 0:
    print(abs(a - b) // 2)
else:
    small, big = min(a, b), max(a, b)
    print(min(
        (small - 1) + 1 + ((big - (small - 1) - 1 - 1) // 2),
        (n - big) + 1 + ((n - (small + (n - big) + 1)) // 2)
    ))
# Judge status: Accepted
n = int(input())
yokolist = list(map(int, input().split()))

count = 0
for i in range(n-2):
    for j in range(i,n-1):
        for k in range(j,n):
            x = yokolist[i]
            y = yokolist[j]
            z = yokolist[k]
            if x != y and y != z and z != x:
                if x < y + z and y < x + z and z < x+ y:
                    count += 1

print(count)
# Judge status: Accepted
import math
a,b,c,d=map(int,input().split())
lcm=(c*d)//math.gcd(c,d)
print((b-(b//c+b//d-b//lcm))-(a-1-((a-1)//d+(a-1)//c-(a-1)//lcm)))
# Judge status: Wrong Answer
n = int(input())
ans = 0
for i in range(1, n+1):
    if (i // 10 + 1) % 2 == 1:
        ans +=1
print(ans)
# Judge status: Wrong Answer
n = int(input())
A = list(map(int,input().split()))

ans = 0
pass_flag = False
for i in range(1,n-1):
    if pass_flag:
        pass_flag = False
        continue
    if A[i-1] < A[i] and A[i] > A[i+1]:
        if not ans:
            ans += 1
        ans += 1
        pass_flag = True
    if A[i-1] > A[i] and A[i] < A[i+1]:
        if not ans:
            ans += 1
        ans += 1
        pass_flag = True

print(ans)
# Judge status: Accepted
from collections import deque
s, t = [0, 0], [0, 0]
s[0], s[1], t[0], t[1] = map(int, input().split())

dx, dy = t[0] - s[0], t[1] - s[1]
ans = deque()

ans.append("U" * (dy))
ans.append("R" * (dx + 1))
ans.append("D" * (dy + 1))
ans.append("L" * (dx + 1))
ans.append("U")

ans.append("L")
ans.append("U" * (dy + 1))
ans.append("R" * (dx + 1))
ans.append("D" * (dy + 1))
ans.append("L" * dx)

print("".join(ans))
# Judge status: Wrong Answer
A, B = map(int, input().split())

a, b = A, B
set_a = set([1])
set_b = set([1])

for n in range(2, int(A ** 0.5) + 1):
    if a % n == 0:
        set_a.add(n)
    while a % n == 0:
        a //= n
        print(a)

if a != 1:
    set_a.add(a)

for n in range(2, int(B ** 0.5) + 1):
    if b % n == 0:
        set_b.add(n)
    while b % n == 0:
        b //= n

if b != 1:
    set_b.add(b)

ans = len(set_a & set_b)
print(ans)
# Judge status: Accepted
N = int(input())
B = list(map(int, input().split()))

A = []

for i in range(N):
    if i == 0:
        A.append(B[0])
    elif i == N - 1:
        A.append(B[-1])
    else:
        A.append(min(B[i-1], B[i]))

print(sum(A))
# Judge status: Accepted
N = int(input())

ans = [0] * (N+1)
for a in range(1, 105):
  if a*a > N :
    break
  for b in range(1, 105):
    if a*a + b*b > N:
      break      
    for c in range(1, 105):
      if a*a + b*b + c*c + a*b + b*c + c*a > N:
        break
      ans[a*a + b*b + c*c + a*b + b*c + c*a] += 1

for i in range(1, N+1):
  print(ans[i])
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

n, *a = map(int, read().split())

res = gcd(a[0],a[1])
for i in range(2,n):
    res = gcd(res, a[i])

print(res)