peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
import math
S = int(input())
if S < 3:
	print(0)
else:
	n = S//3
	surp = S%3
	ans = 0
	while n > 0:
		ans += (math.factorial(surp+n-1)//math.factorial(surp)//math.factorial(n-1))
		ans  = ans % 1000000007
		n = n - 1
	print(ans)
# Judge status: Accepted
#ARC080-C
n = int(input())
a = list(map(int,input().split()))

four = 0
even = 0
odd = 0
for i in a:
    if i%4 == 0:
        four += 1
    elif i % 2 == 0:
        even += 1
    else:
        odd += 1

if even > 0 and even % 2 == 1:
    odd += 1
    
if four + 1 >= odd:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n = input()    
m = n.split()
p = [int(i) for i in m]
a = []
for i in range(p[0]):
    if i < p[1]:
        a.append(str(p[2]))
    else:
        a.append(str(p[2]+1))
A = " ".join(a)
print(A)
# Judge status: Accepted
N = int(input())

a=0;b=0;c=0
L = list(map(int,input().split()))
for i in range(N):
  if L[i]%4 == 0:
    c += 1
  elif L[i]%2 == 0:
    b += 1
  else:
    a += 1
t = a+b+c
#print(a,b,c)
ans = "No"
if a == 0:
  ans = "Yes"
elif c >= a:
  ans = "Yes"
elif b == 0 and a == c+1:
  ans ="Yes"
print(ans)
# Judge status: Accepted
#ABC045

s = [input() for _ in range(3)]
a = ["a","b","c"]
turn = 0
c = True
while c:
    if s[turn] == "":
        print(a[turn].upper())
        break
    else:
        x = s[turn][0]
        s[turn] = s[turn][1:]
        turn = a.index(x)
# Judge status: Accepted
s = input()
setslen = len(set(s))
if setslen == 2:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    L, R = map(int, readline().split())

    if R - L >= 10000:
        print(0)
    else:
        A = [i % 2019 for i in range(L, R + 1)]
        A.sort()
        print(A[0] * A[1])

    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
a, b, c, x, y = map(int, input().split())

if x < y:
    print(min(2*c*y, 2*c*x+b*(y-x), a*x+b*y))
else:
    print(min(2*c*x, 2*c*y+a*(x-y), a*x+b*y))
# Judge status: Accepted
n,m = map(int,input().split())
ab_lst = [list(map(int,input().split())) for i in range(n)]
ab_lst.sort()
total_money = 0
total_number = 0

for i in range(n):
    money = ab_lst[i][0]
    number = ab_lst[i][1]
    number = min(number, m-total_number)

    total_money += number * money
    total_number += number

    if total_number==m:
        break

print(total_money)
# Judge status: Wrong Answer
N, L = [int(i) for i in input().split(' ')]

words = [input() for i in range(N)]

words.sort(key=lambda x: x[0])

for word in words:
    print(word)
# Judge status: Wrong Answer
n,k=map(int,input().split())
S=input()
c=0
d=0
for i in range(n-1):
    if S[i]==S[i+1]:
        c+=1
    if S[i]!=S[i+1]:
        d+=1
print(c+2*d-1 if (d<=k and S[0]!=S[-1]) else c+2*min(d,k))
# Judge status: Accepted
S = input()
if S == 'AAA' or S == 'BBB':
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
N = int(input())
C = [0]
S = [0]
F = [0]
for i in range(N - 1):
    c, s, f = map(int, input().split())
    C.append(c)
    S.append(s)
    F.append(f)

for i in range(1, N):
    t = 0
    for j in range(i, N):
        if j == i:
            t += S[j]
        if t >= S[j]:
            t += t % F[j] + C[j]
        else:
            t = S[j] + C[j]
    print(t)
print(0)
# Judge status: Accepted
from collections import Counter


def main():
    n, m = map(int, input().split())
    a = Counter(list(map(int, input().split())))
    cards = []
    for i, v in a.items():
        cards.append([i, v])
    for _ in range(m):
        cards.append(list(map(int, input().split()))[::-1])
    cards.sort(key=lambda x: x[0], reverse=True)
    ans = 0
    for i, v in cards:
        ans += i * min(v, n)
        n -= min(v, n)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(n-1):
  if ans > A[i+1]:
    print('No')
    exit()
  if A[i+1]-A[i] >= -1:
    ans = max(A[i+1]-1,A[i]-1,ans)
    if A[i+1] >= A[i] and A[i+1] > ans :
      A[i+1] -=1
  else:
    print('No')
    exit()
print('Yes')
# Judge status: Wrong Answer
n, m = map(int, input().split())

if n==1:
  print(m-2)
elif m==1:
  print(n-2)
else:
  print((n-2)*(m-2))
# Judge status: Accepted
import sys
input = sys.stdin.readline
N = int(input())
S = list(input().rstrip())
ans = [0]
x = 0
for i in S:
    if i == "I":
        x += 1
    else:
        x -= 1
    ans.append(x)
print(max(ans))
# Judge status: Accepted
N, Q = map(int, input().split())
S = str(input())
Cs = []
for _ in range(Q):
  l, r = map(int, input().split())
  Cs.append((l, r))

det_idx = []
for i in range(N-1):
  if S[i:i+2] == 'AC':
    det_idx.append(i)

from bisect import bisect_left
for c in Cs:
  ans = bisect_left(det_idx, c[1]-1) - bisect_left(det_idx, c[0]-1)
  print(ans)
# Judge status: Wrong Answer
N = int(input())
T = [[0,0,0]]+[map(int, input().split()) for _ in range(N)]
flag = 'Yes'
i = 0
# while flag=='Yes' and i<len(T)-1:
#     t1,x1,y1 = T[i] 
#     t2,x2,y2 = T[i+1]
#     dis = abs(x2-x1)+abs(y2-y1)
#     _t = t2-t1
#     if dis > _t or _t%2 != dis%2:
#         flag = 'No'
#     i += 1        
print(flag)
# Judge status: Accepted
#B
import math
n = int(input())
count=0
for i in range(1, n + 1):
    if int(math.log10(i) + 1) % 2 != 0:
        count += 1
print(count)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

for i in range(1, n):
    print(a.count(i))
# Judge status: Accepted
x ,n= list(map(int, input().split()))
if n == 0:
    p = input()
    print(x)
else:
    p = list(map(int, input().split()))
    d = 0
    answer = 0
    while True:
        if x-d not in p:
            answer = x-d
            break
        elif x+d not in p:
            answer = x+d
            break
        d += 1
    print(answer)
# Judge status: Wrong Answer
N = int(input())
a = [int(i) for i in input().split()]

now = 1
print(now)

for i in range(N-1):
    A = a[i]^a[i+1]
    now = A^now
    print(now)
# Judge status: Accepted
x=int(input())
if 400<=x<600:
  print('8')
elif 600<=x<800:
  print('7')
elif 800<=x<1000:
  print('6')
elif 1000<=x<1200:
  print('5')
elif 1200<=x<1400:
  print('4')
elif 1400<=x<1600:
  print('3')
elif 1600<=x<1800:
  print('2')
else:
  print('1')
# Judge status: Accepted
x, n = map(int, input().split())
p = list(map(int, input().split()))
i = 0
while True:
    if not (x - i) in p:
        print(x-i)
        exit()
    if not (x + i) in p:
        print(x+i)
        exit()
    i += 1
# Judge status: Wrong Answer
n = int(input())

v = 1
for _ in range(n):
  v = v*v
  
print(v%(1e9+7))
# Judge status: Accepted
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

s = [_ for _ in input()]
t = [_ for _ in input()]

ans = 10**10

for i in range(len(s) - len(t)+1):
  a = 0
  for j in range(len(t)):
    if s[i+j] != t[j]:
      a+=1
  ans = min(a,ans)
print(ans)
# Judge status: Accepted
from collections import Counter


def main():
    N, K = list(map(int, input().split(' ')))
    A = list(map(int, input().split(' ')))
    counter = Counter(A)
    n_kind = len(counter.keys())
    if n_kind <= K:
        print(0)
    else:
        counts = list(counter.values())
        counts.sort()
        print(sum(counts[:(n_kind - K)]))



if __name__ == '__main__':
    main()
# Judge status: Accepted
X, Y, A, B, C = map(int, input().split())
p = sorted(map(int, input().split()), reverse=True)[:X]
q = sorted(map(int, input().split()), reverse=True)[:Y]
r = list(map(int, input().split()))

ans = sum(sorted(p+q+r, reverse=True)[:X+Y])
print(ans)
# Judge status: Accepted

S = input()
answer = ""
for s in S:
    answer += "x"
print(answer)
# Judge status: Accepted
#!/usr/bin/env python3
n, t, a, *h = map(int, open(0).read().split())
mni = 0
mn = 1e18
for i in range(n):
	if mn>=abs(t-h[i]*0.006 - a):
		mn = abs(t-h[i]*0.006 - a)
		mni = i
print(mni+1)
# Judge status: Accepted
from fractions import gcd
lcm = lambda a, b: a * b // gcd(a, b)
num_of_multi = lambda n: b // n - a // n - bool(a % n) + 1

a, b, c, d = map(int, input().split())
print(b - a + 1 - num_of_multi(c) - num_of_multi(d) + num_of_multi(lcm(c, d)))
# Judge status: Accepted
n, k, s = map(int,input().split())
if s != 10**9:
    a = [s+1] * n 
else:
    a = [s-1] * n

for i in range(k):
    a[i] = s
print(*a)
# Judge status: Accepted
def collatz(num):
    if num % 2 == 0:
        return num // 2
    elif num % 2 == 1:
        return num * 3 + 1

n = int(input())
collatz_list = [n]

for i in range(10**6):
    n = collatz(n)
    if not n in collatz_list:
        collatz_list.append(n)
    else:
        print(i+2)
        break
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
p=0
for i in l:
    p^=i
ans=[]
for i in l:
    ans.append(p^i)
print(*ans)
# Judge status: Accepted
import math
import copy
import time


line1 = str(input()).split(" ")

for index in range(len(line1)):
    line1[index] = int(line1[index])
if (line1[1] > 1 and line1[0] > 1):
    print( line1[0]*line1[1] - (2*line1[1] + 2*(line1[0]-2)))
elif (line1[1] == 1 and line1[0] == 1):
    print(1)
elif (line1[1] == 0 or line1[1] == 0):
    print(0)
else:
    print(line1[0]*line1[1] - 2)
# Judge status: Accepted
n, m = map(int, input().split())
ll = [[0]] + [ [] for _ in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    ll[a].append(b)
    ll[b].append(a)
for l in ll[1:]:
    print(len(l))
# Judge status: Accepted
N, K, Q = map(int, input().split())
p = [0]*N
for _ in range(Q):
    #p = list(map(lambda x : x-1, p))
    A = int(input())
    p[A-1] += 1

for ans in p:
    if ans <= Q-K:
        print("No")
    else:
        print("Yes")
# Judge status: Wrong Answer
n,k=map(int,input().split())
t = int(n/k)
tt = t + 1
a = n - t*k
b = tt*k - n
ans=min([a,b])
print(str(ans))
# Judge status: Accepted
N = int(input())
a = [int(x) for x in input().split()]

dict = {}
ans = 0
count = 0
for i in range(N):
    if not( a[i]//400 in dict.keys() ):
        dict[a[i]//400] = 1
    else:
        dict[a[i]//400] += 1
for key in dict.keys():
    if key < 8:
        ans += 1
    else:
        count += dict[key]
if ans == 0:
    print(1, count)
else:
    print(ans, ans+count)
# Judge status: Accepted
from collections import Counter

N = int(input())
*D, = map(int, input().split())
mod = 998244353
c = Counter(D)
v = max(D)

if c[0]!=1 or D[0]!=0:
    print(0)
else:
    ans = 1
    for i in range(1, v+1):
        ans *= pow(c[i-1], c[i], mod)
        ans %= mod
    print(ans)
# Judge status: Accepted
n = int(input())
l = [i for i in range(1,n+1) if i%3!=0 and i%5!=0]
print(sum(l))
# Judge status: Wrong Answer
from sys import stdin, stdout
def main():
    n=stdin.readline().rstrip()
    if '7' in n:
        print('YES')
        return
    print('NO')
    return
main()
# Judge status: Accepted
def solve():
    N = int(input())
    A = list(map(int, input().split()))
    m = 10 ** 9
    
    for i in range(1, 101):
        tmp = 0
        for j in range(N):
            tmp += (i - A[j]) ** 2 
        m = min(tmp, m)

    return m

print(solve())
# Judge status: Wrong Answer
N, M = map(int,input().split())
like = [0 for i in range(M+1)]

for i in range(N):
    KA = list(map(int,input().split()))

    for k in range(KA[0]):
        like[KA[k]] += 1

ans = 0
for i in range(M+1):
    if like[i] == N:
        ans += 1

print(ans)
# Judge status: Accepted
def resolve():
	n = int(input())
	ans = 1000000
	a = list(map(int, input().split()))
	for i in range(-100, 101):
		tmp = 0

		for j in a:
			tmp += (j-i)**2
		if tmp < ans:
			ans = tmp
	print(ans)

resolve()
# Judge status: Accepted
N = int(input())
A_list = list(map(int, input().split()))

dic = {4: 0, 2: 0, 1: 0}
for i in A_list:
    if i % 4 == 0:
        dic[4] += 1
    elif i % 2 == 0:
        dic[2] += 1
    else:
        dic[1] += 1
dic[4] += dic[2] // 2

if len(A_list) // 2 <= dic[4]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys
input = sys.stdin.readline
X, A, B = [int(x) for x in input().split()]
if (A - B) >= 0:
    print("delicious")
elif (B - A) <= X:
    print("safe")
else:
    print("dangerous")
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))
l.sort()
c = 1
i = 0
while i < n:
  c *= l[i]
  i += 1
  if c > 1000000000000000000:
    break
if c <= 1000000000000000000:
  print(c)
else:
  print(-1)
# Judge status: Accepted
p = [int(i) for i in input().split()]
p.sort()
print(p[0] + p[1])
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
a.sort()
n = a[-1]
diff = 10**18
r = -1

for ai in a:
    if abs(n-2*ai)<diff:
        diff = abs(n-2*ai)
        r = ai

print(n, r)
# Judge status: Accepted
def mainFunc():
    S, T = input().split(" ")
    print(T + S)

mainFunc()
# Judge status: Accepted
n, x = map(int, input().split())
a = list(map(int, input().split()))
ans = 0

for i in range(n-1):
    j = i + 1
    if j < n and a[i]+a[j] > x:
        d = min(a[j], (a[i]+a[j]) - x)
        a[j] -= d
        ans += d
    if a[i]+a[j] > x:
        d = min(a[i], (a[i]+a[j]) - x)
        a[i] -= d
        ans += d
print(ans)
# Judge status: Accepted
s= input()
t= input()

atmp=2000
for i in range(len(s) - len(t) + 1):
    s1=s[i:i+len(t)]
    #print(s1)
    tmp=0
    for j in range(len(t)):
        if s1[j]!=t[j]:
            tmp+=1
    atmp=min(atmp,tmp)
        
print(atmp)
# Judge status: Accepted
#!/usr/bin/env python

n = int(input())

if n == 0:
    print(0)
    exit()

ans = ''
while abs(n) > 0:
    r = n%2 
    ans += str(r) 
    n //= 2
    n = -n

if abs(n)%2 == 1:
    print(ans)
else:
    print(ans[::-1])
# Judge status: Accepted
W, H, x, y =  map(int,input().split())
print((H*W)/2, 1 if (x==W/2 and y==H/2) else 0)
# Judge status: Accepted
C = [list(map(int, input().split())) for _ in range(3)]
for i in range(2):
    for j in range(2):
        if C[i+1][j] - C[i][j] != C[i+1][j+1] - C[i][j+1]:
            print('No')
            exit()
print('Yes')
# Judge status: Accepted
#NEED RE-SOLVE LATER.
from collections import deque
n, m = map(int, input().split())
G = [[] for _ in range(n)]
for i in range(m):
    a, b = map(lambda x: x-1, map(int, input().split()))
    G[a].append(b)
    G[b].append(a)

q = deque([0])
visited = [None]+[-1]*(n-1)
while q:
    nx = q.pop()
    for g in G[nx]:
        if visited[g] != -1:
            continue
        visited[g] = nx
        q.appendleft(g)

print('Yes')
print(*[visit+1 for visit in visited[1:]], sep='\n')
# Judge status: Accepted
n,a,b=map(int,input().split())
mod = 1000000007
ans = pow(2,n,mod) - 1

def solve(nu):
    res = 1
    for i in range(nu):
        res *= n-i
        res %= mod
        res *= pow(i+1,mod-2,mod)
        res%=mod
    return res

ans -=solve(a)
ans %= mod
ans -= solve(b)
ans %= mod

print(ans)
# Judge status: Accepted
from collections import deque
import sys
input = sys.stdin.readline

S = input().rstrip()
Q = int(input())
FTC = [tuple(input().split()) for _ in range(Q)]

que = deque(['?'])
cnt = 0
for query in FTC:
    if query[0] == '1':
        cnt ^= 1
        continue

    sign = 0 if query[1] == '1' else 1

    if sign ^ cnt == 0:
        que.appendleft(query[2])
    else:
        que.append(query[2])

que = list(que)
ans = ''.join(que[:: (-1)**cnt])
ans = ans.replace('?', S[:: (-1)**cnt])

print(ans)
# Judge status: Accepted
abc=list(map(int,input().split()))
abc.sort()

ans=abc[2]-abc[1]
abc[0]+=abc[2]-abc[1]
abc[1]=abc[2]


while True:
    if (abc[2]-abc[0])%2==0:
        break
    ans+=1
    abc[2]+=1

ans+=(abc[2]-abc[0])//2
print(ans)
# Judge status: Wrong Answer
def main():
	n = int(input())
	a = list(map(int,input().split()))
	a.sort()
	ans = 0
	for i in range(len(a)-1):
		if a[i] == a[i+1]:
			ans = 1
	if ans == 1:
 		print("No")
	else:
 		print("Yes")
	
 
if __name__ == '__main__':
	main()
# Judge status: Accepted
S=input()
N=len(S)
flag=True
for i in range(N):
    if i%2==0:
        if S[i]=='L':
            flag=False
            break
    else:
        if S[i]=='R':
            flag=False
            break
if flag:print('Yes')
else:print('No')
# Judge status: Accepted
x,y = map(int,input().split())
i = 0
while x <= y:
    x = x*2
    i += 1
print(i)
# Judge status: Wrong Answer
n=int(input())
p=list(map(int,input().split()))
a = 0
for i in range(n-2):
    a += 1*(0<((p[i] < p[i+1])*(p[i+1] < p[i+2])))
print(a)
# Judge status: Accepted
import numpy as np
n, d = map(int, input().split())
x = [np.array(list(map(int, input().split()))) for _ in range(n)]
cnt = 0
for i in range(len(x)-1):
  x_i = x[i]
  for j in x[i+1:]:
    m = x_i - j
    if float(np.linalg.norm(m)).is_integer():
      cnt += 1
print(cnt)
# Judge status: Accepted
def main():
    N = int(input())
    A = list(int(input()) for _ in range(N))
    cnt = 0
    for i in range(N):
        if i == N-1:
            cnt += A[i] // 2
            break
        cnt += A[i] // 2
        mod = A[i] % 2
        if A[i+1] >= mod:
            cnt += mod
            A[i+1] -= mod

    print(cnt)



if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
S=int(input())
if S==25:
  print("Crisitmas")
if S==24:
  print("Christmas Eve")
if S==23:
  print("Christmas Eve Eve")
if S==22:
  print("Christmas Eve Eve Eve")
# Judge status: Accepted
n, m = input().split()
print('Yes' if n == m else 'No')
# Judge status: Accepted
import fractions

A, B = [int(i) for i in input().split()]

C = fractions.gcd(A, B)
print(int((A * B)/C))
# Judge status: Accepted
a,b=map(int,input().split())
print('Yay!' if a<9 and b<9  else ':(')
# Judge status: Accepted
N, C, K = list(map(int,input().split()))
listT = [int(input()) for _ in range(N)]

listT.sort()

count=0
while listT != []:
    bus = []
    time = listT[0]
    count += 1
    while len(bus) != C and time+K>=listT[0]:
        bus.append(listT.pop(0))
        if listT==[]:
            break

print(count)
# Judge status: Accepted
# coding: utf-8
# Your code here!

if __name__ == '__main__':
    today=input()
    week=["SUN","MON","TUE","WED","THU","FRI","SAT"]
    week=week[::-1]
    print(week.index(today)+1)
# Judge status: Wrong Answer
import itertools

N = int(input())
for n in range(1,N+1):
    cnt = 0
    for x,y in itertools.product(list(range(n)),repeat=2):
        z = n - x - y
        if n == x*x + y*y +z*z + x*y + y*z + z*x:
            cnt += 1
    print(cnt)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline


def main():

    s = input()
    q = int(input())
    ls = [input().split() for _ in range(q)]

    for t in ls:
        if t[0] == '1':
            s = s[::-1]
        elif t[0] == '2':
            if t[1] == '1':
                s = t[2] + s
            elif t[1] == '2':
                s = s + t[2]
    
    print(s[:-1])

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    st = list(map(str, str(input().rstrip('\n')).split()))
    ab = list(map(str, str(input().rstrip('\n')).split()))
    d = {s: int(v) for s, v in zip(st, ab)}
    d[str(input().rstrip('\n'))] -= 1
    print(*d.values())


if __name__ == '__main__':
    solve()
# Judge status: Wrong Answer
n = int(input())
l = [[int(i) for i in input().split()] for _ in range(n)]

ans = 0
p = 0
for i in l[::-1]:
    i[0] += p
    ans += i[1] - (i[0] % i[1]) if i[1] > 1 else 0
    p += i[1] - (i[0] % i[1]) if i[1] > 1 else 0
    
print(ans)
# Judge status: Accepted
from collections import Counter
#l = ['a', 'a', 'a', 'a', 'b', 'c', 'c']
#c = Counter(l)
#print(c)   # Counter({'a': 4, 'c': 2, 'b': 1})

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

C = Counter(a)

ans = 0
for k, v in C.items():
    k = int(k)
    
    if k<v:
        ans += (v-k)
    elif k>v:
        ans += v

print(ans)
# Judge status: Accepted
N = int(input())
List = list(map(int, input().split()))
res = 0
if N >=3:
  for i in range(N-2):
    for j in range(i+1,N-1):
      for k in range(j+1,N):
        if List[i]==List[j] or List[i]==List[k] or List[k]==List[j]:
          pass
        else:
          if List[i]+List[j] > List[k] and List[j]+List[k] > List[i] and List[k]+List[i] > List[j]:
            res += 1
print(res)
# Judge status: Wrong Answer
X=int(input())
a=True
for A in range(118+119):
    if(a):
        for B in range(118+119):
            if((A-118)**5-(B-118)**5==X):
                print(A-118,B-118)
                a=False
                break
# Judge status: Accepted
from collections import defaultdict
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N = int(input())

    ans = defaultdict(int)
    for x in range(1, 101):
        for y in range(1, 101):
            for z in range(1, 101):
                n = x * x + y * y + z * z + x * y + y * z + z * x
                ans[n] += 1

    for i in range(1, N + 1):
        print(ans[i])


main()
# Judge status: Wrong Answer
H, A = map(int, input().split())

if H%A == 0:
  print(H/A)
else:
  print(int(H/A) +1)
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
num = 0

for i in range(n):
    if h[i] < num-1:
        print("No")
        exit(0)
    num = max(num, h[i])

print("Yes")
# Judge status: Accepted
import math
x = int(input())
# 6,5,6,5 ・・・と得点していく
# 答えはx/5.5付近
t = math.ceil(x/5.5)
def f(n):
    return 6*n - n//2

if x <= f(t-1):
    print(t-1)
elif x <= f(t):
    print(t)
else:
    print(t+1)
# Judge status: Accepted
#49
moji=input()
boin=['a','e','i','o','u']
if (moji==boin[0] or moji==boin[1] or moji==boin[2] or moji==boin[3] or moji==boin[4]):
    print('vowel')
else:
    print('consonant')
# Judge status: Accepted
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

cnt2 = 0
cnt4 = 0

for a in A:
    if a % 4 == 0:
        cnt4 += 1
    elif a % 2 == 0:
        cnt2 += 1

if cnt2 // 2 + cnt4 >= N // 2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys
from collections import Counter
from collections import deque
import math
import fractions
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
au=lmp()
ad=lmp()
u=[0]*n
d=[0]*n
u[0]=au[0]
d[0]=sum(ad)
for i in range(1,n):
    u[i]=u[i-1]+au[i]
    d[i]=d[i-1]-ad[i-1]
ans=[0]*n
for i in range(n):
    ans[i]=u[i]+d[i]
print(max(ans))
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=0
for i in a:
  ans+=b[i-1]
for i in range(n-1):
  if a[i]+1==a[i+1]:ans+=c[a[i]-1]
print(ans)
# Judge status: Accepted
S = input()

for i in range(len(S)-1):
    print('x', end="")

print('x')
# Judge status: Wrong Answer
from unittest.mock import patch
import numpy as np

def takahashi_info():
    
    A = []
    for i in range(3):
        A += [int(j) for j in input().split()]

        
    if sum(A) % 3 == 0:
        print("Yes\n")
    
    else:
        print("No\n")
# Judge status: Wrong Answer
N = int(input())
A = list(map(int,input().split()))
B = A
S = sum(A)
B.reverse()
cum1 = [0]*(N)
cum2 = [0]*(N)
now1 = 0
for i in range(N):
  now1 += A[i]
  cum1[i] = now1
  cum2[i] = S-now1
minimum = 10**9
for i in range(N):
  if abs(cum1[i]-cum2[i]) < minimum:
    minimum = abs(cum1[i]-cum2[i])
print(minimum)
# Judge status: Wrong Answer
N, K = map(int, input().split())
H = list( map(int, input().split()) )
H.sort()
#h = H[:N-K]
print(sum(H[0:N-K]))
# Judge status: Accepted
S=[0]+list(input())
L=[0]
SET=["A","G","C","T"]
SET=set(SET)
for i in range(1,len(S)):
    if S[i] not in SET:
        L.append(0)
    else:
        L.append(L[-1]+1)
print(max(L))
# Judge status: Accepted
w, h = (int(x) for x in input().split())
ab = []
for _ in range(h):
    a, b = (int(x) for x in input().split())
    ab.append([a, b])

dp = [0] * (w + max(a for a, b in ab))

for j in range(1, w+1):
    dp[j] = min(dp[j-a]+b for a, b in ab)

print(dp[w])