peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
x, y = map(int, input().split())
if x%y == 0:
    print(-1)
else:
    print(x)
# Judge status: Wrong Answer
from collections import Counter

s,t = open(0).read().split()
ss = set(s)
st = set(t)
ls = [ord(x) for x in ss]
lt = [ord(x) for x in st]
cs = Counter([ord(x) for x in s])
ct = Counter([ord(x) for x in t])
if len(ls) == 1 and len(lt) == 1:
    if len(s) < len(t):
        print('Yes')
    else:
        print('No')
else:
    if min(ls) >= max(lt):
        if cs[min(ls)] < ct[max(lt)]:
            print('Yes')
        else:
            print('No')
    else:
        print('Yes')
# Judge status: Accepted
n,k = list(map(int,input().strip().split()))

dic= {}
for i in range(n):
  a,b = list(map(int,input().strip().split()))
  if a in dic:
    dic[a] += b
  else:
    dic[a] = b

arr = sorted(dic.items())
leng = 0
for i in arr:
  leng += i[1]
  if leng >= k:
    print(i[0])
    exit()
# Judge status: Wrong Answer
K,S = map(int,input().split())

cnt = 0

for x in range(K):
  for y in range(K):
    z = S - x - y
    if z <= K and x + y + z == S:
      cnt +=1
print(cnt)
# Judge status: Accepted
N = int(input())
P = list(map(int, input().split()))

ans = 0
min = P[0]
for i in range(N):
	if min >= P[i]:
		ans += 1
		min = P[i]

print(ans)
# Judge status: Accepted
a,b,k = map(int, input().split())
res = []
flg = 0
for i in range(1,101):
  if a % i == 0 and b % i == 0:
    res.append(i)
print(res[-k])
# Judge status: Accepted
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    n, m, k = LI()
    for i in range(n):
        for j in range(m+1):
            if i*m + j*(n-2*i) == k:
                print("Yes")
                exit(0)
    else:
        print("No")
main()
# Judge status: Wrong Answer
a,s=int(input()),input()
print(s if a<3200 else 'red')
# Judge status: Accepted
#abc064 b
a,b,x=map(int,input().split())
ans=b//x-(a-1)//x
print(ans)
# Judge status: Accepted
import sys

readline = sys.stdin.readline
N = int(readline())
CSF = [tuple(map(int, readline().split())) for _ in range(N-1)]
for i in range(N):
    time = 0
    for c, s, f in CSF[i:N-1]:
        if time < s:
            time = s
        else:
            time = (time+f-1)//f*f
        time += c
    print(time)
# Judge status: Accepted
n,m=map(int,input().split())
yakusuu=[]
for i in range(1,int(m**0.5)+1):
  if m%i==0:
    yakusuu.append(m//i)
    if m//i==i:continue
    yakusuu.append(i)
ans=0
for y in yakusuu:
  if y<n:continue
  if m%y==0:
    ans=max(ans,m//y)
print(ans)
# Judge status: Accepted
N = list(map(int,list(input())))
ans = max(sum(N),N[0]-1+9*(len(N)-1))
print(ans)
# Judge status: Accepted
N,X = map(int,input().split())
List = list(map(int,input().split()))
abs_List = [abs(List[i] - X) for i in range(N)]

import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def gcd_list(numbers):
    return reduce(math.gcd, numbers)

print(gcd(*abs_List))
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
s=sum(A)
res=0
for i in range(N-1):
    s-=A[i]
    res+=A[i]*s
print(res%(10**9+7))
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))

if(N%2 == 0):
  N = int(N/2)
else:
  N = int(N/2)+1
count = 0
for i in range(1,N+1):
  if(a[(2*i-1)-1]%2 == 1):
    count += 1
print(count)
# Judge status: Accepted
N, M = map(int, input().split())
Price = [tuple(map(int, input().split())) for _ in range(N)]
Price.sort()
ans = 0
for (a, b) in Price:
    if M >= b:
        ans += a * b
        M -= b
    else:
        ans += a * M
        M = 0
        break
print(ans)
# Judge status: Accepted
S=input()
if ('a' in S) and ('b' in S) and ('c' in S):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
s,w = map(int, input().split(' '))

if w >= s/2:
    print('unsafe')
else:
    print('safe')
# Judge status: Wrong Answer
def main():
    x, y = map(int, input().split())
    A = abs(abs(x) - abs(y))

    if x < 0 and y < 0 and x < y:
        B = 0
    elif x < 0 and y < 0 and x > y:
        B = 2
    elif x >= 0 and y >= 0:
        if x < y:
            B = 0
        else:
            B = 2
    else:
        B = 1

    print(A + B)


if __name__ == "__main__":
    main()
# Judge status: Accepted
def gcd(x, y):
    while y > 0:
        r = x % y
        x = y
        y = r
    return x

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

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

l = 1
for i in range(n):
    a[i] //= 2
    l = lcm(a[i], l)

flg = True
for x in a:
    if (l // x) % 2 == 0:
        flg = False
        break

if flg:
    print(m // l - m // (l * 2))
else:
    print(0)
# Judge status: Accepted
N = int(input())

dp = [N for i in range(N+1)]

pow6 = [6**i for i in range(1,8)]
pow9 = [9**i for i in range(1,7)]

#print(pow6)
#print(pow9)
dp[0] = 0
for i in range(N+1):
    dp[i] = min(dp[i], dp[i-1]+1)
    for j in pow6:
        if i-j>=0:
            dp[i] = min(dp[i], dp[i-j] + 1)
    for j in pow9:
        if i-j>=0:
            dp[i] = min(dp[i], dp[i-j] + 1)

#print(dp)
print(dp[-1])
# Judge status: Accepted
a=list(input().split())
aa=int(''.join(a))

for i in range(1,1000000):
    if i*i==aa:
        print('Yes')
        break
else:
    print('No')
# Judge status: Accepted
a = int(input())
b = int(input())
h = int(input())

print(int((b+a) * h / 2))
# Judge status: Wrong Answer
N=int(input())
dp=[[0]*3 for i in range(N)]
for i in range(1,N):
  a=list(map(int,input().split()))
  for j in range(3):
    for k in range(3):
      if j==k:
        continue
      dp[i][k]=max(dp[i][k],dp[i-1][j]+a[k])
print(max(dp[-1]))
# Judge status: Accepted
X, K, D = map(int, input().split())
X = abs(X)
a = X // D
if K <= a:
    print(X - D * K)
    exit()
X -= D * a
K -= a
if K % 2 == 1:
    print(abs(X - D))
else:
    print(X)
# Judge status: Wrong Answer
n = int(input())
if n % 2 == 0:
    print(int(n/2))
else:
    print(-(-n//2))
# Judge status: Accepted
n = int(input())
s = []
for i in range(n):
    s.append(int(input()))
S = sum(s)

if S % 10 != 0:
    print(S)
    exit()
for a in sorted(s):
    if a % 10 != 0:
        print(S-a)
        exit()
else:
    print(0)
# Judge status: Wrong Answer
x,y=map(int,input().split())
if x==y:
  print(-1)
else:
  for i in range(1,1000000):
    s=x*i
    if s%y!=0:
      print(s)
      exit()
# Judge status: Wrong Answer
q,h,s,d=map(int,input().split())
n=int(input())
l=min(q*n*4,h*n*2,s*n,d*n/2)
if l != d*n/2:
    print(l)
else:
    m=min(q*4,h*2,s)
    print(int(d*(n-1)/2+m))
# Judge status: Wrong Answer
S = input('Day of the week')
print()
if S== 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
elif S == 'SAT':
    print(1)
# Judge status: Accepted
def main():
    n = int(input())
    a_list = list(map(int, input().split()))
    b_list = list(map(int, input().split()))
    ans = 0

    for i in range(n):
        c = min(a_list[i], b_list[i])
        ans += c
        d = min(b_list[i] - c, a_list[i + 1])
        ans += d
        a_list[i + 1] -= d

    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
s=input()
c=0
k=1
while(k!=0):
    b=s.replace('10','')
    c+=len(s)-len(b)
    s=b
    b=s.replace('01','')
    c+=len(s)-len(b)
    k=len(s)-len(b)
    s=b
print(c)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

ans = 0

for i in range(N):
  ans += min(A[i], B[i]) + min(A[i+1], max(B[i] - A[i], 0))
  A[i+1] = max(0, A[i+1] - max(B[i] - A[i], 0))
    
print(ans)
# Judge status: Accepted
s = input()
t = input()

ans=0
for i in range(len(s)):
    if t[i]!=s[i]:
        ans+=1
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,k = map(int,input().split())
X = list(map(int,input().split()))
for i in range(n-k+1):
  fi = X[i]
  en = X[i+k-1]
  if fi <= 0 and en >= 0:
    mans = min(mans,min(-fi,en)-fi+en)
  else:
    mans=min(mans,max(abs(fi),abs(en)))
print(mans)
# Judge status: Accepted
n=int(input())
b=list(map(int,input().split()))
ans=b[0]
for i in range(n-2):
    ans+=min(b[i],b[i+1])
ans+=b[n-2]
print(ans)
# Judge status: Accepted
L,R = list(map(int,input().split()))
if R-L+1 >= 2019:
    ans = 0
else:
    ans = 2019
    lis = [i%2019 for i in range(L,R+1)]
    for i in range(R-L):
        for j in range(i+1,R-L+1):
            s = (lis[i]*lis[j])%2019
            ans = min(s,ans)
print(ans)
# Judge status: Accepted
import numpy as np
bingo = []
for _ in range(3):
    l=list(map(int, input().split()))
    bingo.extend(l)

N = int(input())
indices=[]

for _ in range(N):
    num = int(input())
    if num in bingo:
        indices.append(bingo.index(num))

candidates=[[0,1,2],[3,4,5],[6,7,8],[0,3,6],[1,4,7],[2,5,8],[0,4,8],[2,4,6]]
ans='No'
for candidate in candidates:
    if len(list(set(indices)&set(candidate))) == 3:
        ans='Yes'
        break
print(ans)
# Judge status: Accepted
N=int(input())
S=input()
rn,wn=0,0
for i in range(len(S)):
    if S[i]=='R':
        rn+=1
    else:
        wn+=1
winr,rinw=0,0
for i in range(rn):
    if S[i]=='W':
        winr+=1
for i in range(rn,rn+wn):
    if S[i]=='R':
        rinw+=1
#print(rn,wn,rinw,winr)
print(max(winr,rinw))
# Judge status: Wrong Answer
s = input()
if s == '0000' or (int(s[:2]) >= 13 and int(s[-2:]) >= 13):
    print('NA')
elif 1 <= int(s[:2]) <= 12 and 1 <= int(s[-2:]) <= 12:
    print('AMBIGUOUS')
elif 1 <= int(s[:2]) <= 12:
    print('MMYY')
elif 1 <= int(s[-2:]) <= 12:
    print('YYMM')
# Judge status: Accepted
N, Q = map(int, input().split(' '))
S = input()
queries = tuple(tuple(map(int, input().split(' '))) for _ in range(Q))

cumsum = [0] * (N + 1)
for i in range(N):
    cumsum[i + 1] = cumsum[i]
    if S[i:i + 2] == 'AC':
        cumsum[i + 1] += 1

for left, right in queries:
    print(cumsum[right - 1] - cumsum[left - 1])
# Judge status: Accepted
from collections import deque
N = int(input())
A = deque(map(int, input().split()))
num = 1
ans = 0
while A:
  a = A.popleft()
  if a == num:
    num += 1
  else:
    ans += 1
print(-1 if num == 1 else ans)
# Judge status: Accepted
n=input()
a=sorted([int(i) for i in input().split()])[::-1]
if a[0]<sum(a[1:]):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
# -*- coding: utf-8 -*-
A, x, C = map(str, input().split())
print('A{}C'.format(x[0]))
# Judge status: Accepted
import collections

N = int(input())
A = list([int(input()) for _ in range(N)])
A = collections.Counter(A).values()

ans = [x for x in A if x&1]
print(len(ans))
# Judge status: Wrong Answer
A = input()
B = input()
C = input()
l = [A,B,C]
i = [0,0,0]
p = 0
while i[p] != len(l[p]):
  card = l[p][i[p]] 
  if card == "a":
    i[0] += 1
    p = 0
  if card == "b":
    i[1] += 1
    p = 1
  if card == "c":
    i[2] += 1
    p = 2
print(["A","B","C"][p])
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(n-2):
    if p[i]>p[i+1]>p[i+2] or p[i]<p[i+1]<p[i+2]:
        ans+=1
print(ans)
# Judge status: Accepted
x,a,b=map(int,input().split())
if b-a<=0:
    print('delicious')
elif b-a<=x:
    print('safe')
else:
    print('dangerous')
# Judge status: Accepted
s = input()
n = len(s)

now = '$'
ans = 0
flg = True

while s != '':
    if s[0] != now:
        ans += 1
        now = s[0]
        s = s[1:]
    else:
        if now == s[:2]:
            now = s[:2]
            s = s[2:]
        else:
            ans += 1
            now = s[:2]
            s = s[2:]
            
print(ans)
# Judge status: Accepted
import sys
input = sys.stdin.readline

k = int(input())

if k%2 == 0:
    print(-1)
    exit()

if k == 7:
    print(1)
    exit()

if k == 1:
    print(1)
    exit()

if k % 5 == 0:
    print(-1)
    exit()

seven = 7
d = 1
while seven != 0:
    seven += pow(7*pow(10,d,k),1,k)
    seven = pow(seven,1,k)
    d += 1

print(d)
# Judge status: Accepted
N,M=map(int,input().split())
def divisor(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)
    divisors.sort()
    return divisors
a=divisor(M)
ans=1
for i in a:
    if i *N<=M:
        ans=i
print(ans)
# Judge status: Accepted
n=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
min_t=1000000
for x in H:
    res=abs(A-(T-x*0.006))
    if min_t>=res:
        min_t=min(min_t,res)
        min_idx=H.index(x)
print(min_idx+1)
# Judge status: Accepted
import math

N = int(input())

result1 = 0
result2 = 0
ans = float("inf")
for count in range(1,int(math.sqrt(N))+1):
    if N % count == 0:
        ans = min(ans,count + N // count -2)


print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
dlst = list(input().split())

while 1:
    for num in dlst:
        if num in str(n):
            break
    else:
        print(n)
        break
    n += 1
# Judge status: Wrong Answer
N,M,K = map(int, input().split())
for i in range(N+1):
    b = i * M
    for j in range(M+1):
        b -= j * i
        b += j * (N-i)
        if b == K:
            print('Yes')
            exit()
print('No')
# Judge status: Accepted
A,B,T = map(int,input().split())

time = A
biscuits = 0

while T+0.5 >= time:
  biscuits += B
  time += A
  
print(biscuits)
# Judge status: Accepted
x = int( input() )

if 400 <= x <= 599:
  print("8")
elif 600 <= x <= 799:
  print("7")
elif 800 <= x <= 999:
  print("6")
elif 1000 <= x <= 1199:
  print("5")
elif 1200 <= x <= 1399:
  print("4")
elif 1400 <= x <= 1599:
  print("3")
elif 1600 <= x <= 1799:
  print("2")
elif 1800 <= x <= 1999:
  print("1")
# Judge status: Accepted
import math
import functools
N,X = map(int,input().split())
A = list(map(int,input().split()))
mylist=[abs(X-A[0])]

for i in range(len(A)-1):
    mylist.append(abs(A[i+1]-A[i]))

print(functools.reduce(math.gcd, mylist))
# Judge status: Wrong Answer
A,B=map(int, input().split())
if A>=13:
  print(B)
elif B>=6:
  print('{:.0f}'.format(B/2))
else:
  print(0)
# Judge status: Accepted
n,t=map(int,input().split())
c=1001
for i in range(n):
    cn,tn=map(int,input().split())
    if tn<=t:
        if cn<c:
             c=cn
if c==1001:
    print("TLE")
else:
    print(c)
# Judge status: Wrong Answer
def main():
    S = list(input())
    k = int(input())
    ans = []
    for s in S:
        if k == 0:
            break
        if s != 'a' and ord(s) >= 123 - k:
            ans.append('a')
            k -= 123 - ord(s)
        else:
            ans.append(s)
    if k > 0:
        k %= 26
        ans[-1] = chr((ord(ans[-1]) + k - 97) % 26 + 97)
    print(''.join(ans))

if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
f = 0
t = 0
for ai in a:
  if ai%4 == 0:
    f += 1
  elif ai%2 == 0:
    t += 1
e = n-f-t
if t == 0:
  if f+1 >= e:
    print("Yes")
  else:
    print("No")
else:
  if f >= e:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
a, b, c = map(int, input().split())
if (a+b) >= c:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import bisect
from itertools import accumulate

N, M, K = map(int, input().split())
A = map(int, input().split())
B = map(int, input().split())

A_cumsum = list(accumulate(A))
B_cumsum = list(accumulate(B))

max_books = 0
for a, A_sum in enumerate([0] + A_cumsum):
    if A_sum > K:
        break
    else:
        b = bisect.bisect(B_cumsum, K - A_sum)
        max_books = max(a + b, max_books)

print(max_books)
# Judge status: Accepted
x,y,z = map(int,input().split())
a = z
b = x
c = y
print(a,b,c)
# Judge status: Accepted
w,h,n=map(int,input().split())
white_mostleft=0
white_mostright=w
white_mostup=h
white_mostdown=0

for _ in range(n):
    x,y,a=map(int,input().split())
    if(a==1 and white_mostleft < x):
        white_mostleft=x
    elif(a==2 and white_mostright > x):
        white_mostright=x
    elif(a==3 and white_mostup > h-y):
        white_mostup = h-y
    elif(a==4 and white_mostdown < h-y):
        white_mostdown = h-y

ans=max(0,white_mostright-white_mostleft) * max(0,white_mostup-white_mostdown)
print(ans)
# Judge status: Accepted
from collections import Counter

N = int(input())
A = list(map(int, input().split()))
Q = int(input())
query = [list(map(int, input().split())) for i in range(Q)]

Asum = sum(A)
Adict = Counter(A)

for q in query:
  before = q[0]
  after = q[1]
  if before in Adict:
    Asum += (after-before) * Adict[before]
    if after in Adict:
      Adict[after] += Adict.pop(before)
    else:
      Adict[after] = Adict.pop(before)
  print(Asum)
# Judge status: Accepted
a,b,c=map(int,input().split())
x=[a,b,c]
y=sorted(x)
if (y[0]+y[1])==y[2]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())

cands = [1]
for i in range(1, 7):
  if 6**i <= N:
    cands.append(6**i)
  if 9**i <= N:
    cands.append(9**i)

dp = [10**6] * (N+1)
dp[0] = 0
for i in range(1, N+1):
  for c in cands:
    if c <= i:
      dp[i] = min(dp[i], dp[i-c]+1)

print(dp[-1])
# Judge status: Wrong Answer
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))
from collections import Counter

n=int(input())
a=lnii()

c=Counter(a)
a_max=max(a)

ans=0
for i in range(1,a_max):
  t_ans=c[i-1]+c[i]+c[i+1]
  ans=max(ans,t_ans)

print(ans)
# Judge status: Accepted
x,y,z = map(int, input().split())

print(z, x, y)
# Judge status: Wrong Answer
s = input()
n = len(s) + 1
t = [0]*n
for i in range(n-1):
  if s[i] == '<':
    t[i+1] = t[i] + 1
for i in range(n-2,1,-1):
  if s[i] == '>':
    t[i] = max(t[i],t[i+1]+1)
print(sum(t))
# Judge status: Wrong Answer
d = int(input())

if d == 25: print("Christmas")
elif d == 24: print("Christmas Eve")
elif d == 23: print("Christmas Eve")
elif d == 22: print("Christmas Eve Eve Eve")
# Judge status: Accepted
n,k=map(int,input().split())
h=list(map(int,input().split()))
if n<=k:
    print(0)
else:
    h.sort()
    print(sum(h[0:(n-k)]))
# Judge status: Accepted
d,n = map(int,input().split())
if n == 100:
  print(101*(100**d))
  exit()
  
if d == 0:
  print(n)
elif d == 1:
  print(100*n)
else:
  print(10000*n)
# Judge status: Wrong Answer
A,B,C,K=map(int,input().split())
if K>A+B:
	K=K-(A+B)
	ans=A-K
else:
	ans=A
print(ans)
# Judge status: Accepted
n,*L = map(int,open(0).read().split())
from collections import Counter
L = Counter(L)
li = []
for k,v in L.items():
    li.append([k,v])
li.sort(reverse = True)
LL = []
for i in range(len(li)):
    if li[i][1] >= 2:
        LL.append(li[i])

if len(LL) == 0:
    print(0)
    exit()
if LL[0][1] >= 4:
    print(LL[0][0]**2)
elif len(LL) >=2:
    print(LL[0][0]*LL[1][0])
else:
    print(0)
# Judge status: Accepted
N,M = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
T = []
for i in range(M):
    a,b = map(int,input().split())
    T.append([b,a])
T.sort(reverse=True)

ans = 0
c = 0
k = 0
t = len(T)
for i in range(N):
    if c == t:
        break
    n = T[c][0]
    l = T[c][1]
    k += 1
    if A[i] < n:
        A[i] = n
    else:
        break
    if k == l:
        c += 1
        k = 0
print(sum(A))
# Judge status: Accepted
import sys
X = sys.stdin.readline().rstrip()
S = 0
T = 0
ans = 0
for x in X:
    if x == "S":
        S += 1
    else:
        if not S:
            ans += 1
        else:
            S -= 1
ans += S
print(ans)
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())
if(a > d):
    print(0)
elif(c <= a <= d and b >= d):
    print(d-a)
elif(a < c and b >= d):
    print(d-c)
elif(c <= b):
    print(b-c)
elif(b < c):
    print(0)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 1
m = 0
for i in range(1, n):
    if (a[i] - a[i - 1]) * m < 0:
        ans += 1
        m = 0
    elif a[i] - a[i - 1] != 0:
        m = a[i] - a[i - 1]
print(ans)
# Judge status: Accepted
n,h=map(int, input().split())
a_l=[]
b_l=[]
for _ in range(n):
    a,b=map(int, input().split())
    a_l.append(a)
    b_l.append(b)
a_l.sort(reverse=True)
b_l.sort(reverse=True)
a_max=max(a_l)

b_strong=[]
for b_i in b_l:
    if b_i>a_max:
        b_strong.append(b_i)

cnt=0
for b_s in b_strong:
    if h>0:
        h-=b_s
        cnt+=1
    else:
        break

if h>0:
    cnt+=(h-1)//a_max+1

print(cnt)
# Judge status: Accepted

N = int(input())
L = [2, 1] + [0] * (N-1)
for i in range(2, N+1):
    L[i] = L[i-1] + L[i-2]

print(L[N])
# Judge status: Wrong Answer
n,k=map(int,input().split())
a=[[int(i) for i in input().split()] for i in range(n)]
b=[]
x=0
for i in a:
    x+=i[1]
    b.append([i[0],x])
for i in range(len(b)-1):
    if b[i][1]<k<=b[i+1][1]:
        print(b[i+1][0])
# Judge status: Wrong Answer
a = int(input())
b = int(input())
h = int(input())

ans = (a + b)*h / 2

print(ans)
# Judge status: Accepted
import collections

N,S = open(0).read().split()
max_d = 0
for i in range(int(N)):
  A = set(list(S[:i]))
  B = set(list(S[i:]))
  if max_d < len(A&B):
    max_d = len(A&B)
print(max_d)
# Judge status: Accepted
S = input()

ans = '2018' + S[4:]

print(ans)
# Judge status: Accepted
x = int(input())
k = 0
while True:
  k += 1
  if (x * k)%360 == 0:
    print(k)
    break
# Judge status: Wrong Answer
#B - Iron Bar Cutting
import bisect
N = int(input())
A = list(map(int,input().split()))

length = []
cnt = 0
for i in A:
    cnt += i
    length.append(cnt)
trg_idx_l = bisect.bisect_left(length,length[-1]//2)
if length[trg_idx_l] == length[-1]:
    ans = A[-1]-A[-2]*2
else:
    # length[-1] - ans = 2*(length[target] - ans)
    ans = 2*length[trg_idx_l] - length[-1]
print(ans)
# Judge status: Wrong Answer
D = int(input())

A = ["Chrinstmas"]

for i in range(25 - D):
  A.append("Eve")

S = ' '.join(A)

print(S)
# Judge status: Accepted
def main():
    h, n = map(int, raw_input().split())
    ab = []
    for _ in xrange(n):
        a, b = map(int, raw_input().split())
        ab.append([a, b])
    dp = [float('inf')] * (h + 1)
    dp[0] = 0
    for i in range(1, h + 1):
        for a, b in ab:
            dp[i] = min(dp[i], b + dp[max(0, i - a)])
    print dp[-1]

main()
# Judge status: Wrong Answer
import math
n=int(input())
ans=[0]*(10**5)
for x in range(int(math.sqrt(n))+1):
  for y in range(int(math.sqrt(n))+1):
    for z in range(int(math.sqrt(n))+1):
      ans[((x+y)**2+(y+z)**2+(z+x)**2)//2-1]+=1

for i in range(n):
  print(ans[i])
# Judge status: Accepted
x,n=map(int,input().split())
p=list(map(int,input().split()))
for i in range(1000):
    if x-i not in p:
        print(x-i)
        exit()
    if x+i not in p:
        print(x+i)
        exit()
# Judge status: Wrong Answer
L = int(input())
num = L//3
print(num*num*num)
# Judge status: Accepted
import itertools
n, m, x = map(int, input().split())

c = []
d = []
for i in range(n):
	s = list(map(int, input().split()))
	#a = s.pop(0)
	#c.append(a)
	d.append(s)
ans = 10**9
for i in range(1,n+1):
	for j in itertools.combinations(d,i):
		s = [0 for ii in range(m+1)]
		for k in j:
			for l in range(m+1):
				s[l] += k[l]
		y = min(s[1:])
		if y >= x:
			ans = min(ans,s[0])
if ans == 10**9:
	print (-1)
else:
	print (ans)
# Judge status: Accepted
k, a, b = map(int, input().split())

if b - 2 <= a or k < a + 1:
    print(k + 1)
else:
    r = k - (a - 1)
    print((r // 2 - 1) * (b - a) + b + r % 2)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
count=0
while True:
  temp=0
  for i in range(0,n):
    if a[i]%2==0:
      temp=temp+1
      a[i]=int(a[i]/2)
  if temp==n:
    count=count+1
  else:
    break
print(count)
# Judge status: Wrong Answer
K = int(input())
print(pow(K//2,2)) if K % 2 == 0 else print(pow((K+1)//2,2))