Harryxun/stf_run huggingface dataset:
N = int(input())
S, T = input().split()
A = ""
 
for i in range(N):
    A += S[i]
    A += T[i]
    
print(A)

### FIXED CODE ###

A = int(input())
B = int(input())
 
print(6-A-B)	#和から誤答を引けば正答
W, H, x, y = map(int, input().split())
a = H * (W - x)
b = H * W - H * (W - x)
c = W * (H - y)
d = H * W - W * (H - y)

if W == H:
    if y == x or y == -x + H:
        e = 1
    else:
        e = 0
else:
    if x == W * (1 / 2) and y == H * (1 / 2):
        e = 1
    else:
        e = 0

else:
e = 0

if a <= b:
    if c <= d:
        if a <= c:
            print(c, e)
        else:
            print(a, e)
    else:
        if a <= d:
            print(d, e)
        else:
            print(a, e)
else:
    if c <= d:
        if b <= c:
            print(c, e)
        else:
            print(b, e)
    else:
        if b <= d:
            print(d, e)
        else:
            print(b, e)


### FIXED CODE ###

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

if x == W * (1 / 2) and y == H * (1 / 2):
   e=1
else:
    e=0

print((W*H)*(1/2),e)
x,y,z = map(int,input().split())
count = 0
for i in range(1:x) 
    LIST = [int(x) for x in list(str(i))]
    if y <sum(LIST) <z :
        count +=1        
print(count)

### FIXED CODE ###

x,y,z = map(int,input().split())
count = 0
for i in range(1,x+1) :
    LIST = [int(x) for x in list(str(i))]
    if y <=sum(LIST) <=z :
        count += i       
print(count)
a,b = map(str,input().split())

if a == "H" and b == "H":
    print("H")
elif a == "H" and b == "D":
    print("D")
elif a == "D" and b == "H":
    print("D")
else: a == "D" and b == "D":
    print("H")



### FIXED CODE ###

#AtCoDeerくん
#a = 'H'のとき正直者
#a = 'D'のとき嘘つき
#AtCoDeerくん
#b = 'H'のとき、「TopCoDeerくんは正直者だ」と発言する
#b = 'D'のとき、「TopCoDeerくんは嘘つきだ」と発言する

#TopCoDeerくんが正直者かどうか判定してください。
#a = H b = H →H
#a = H b = D →D
#a = D b = H →D
#a = D b = D →H

a,b = map(str,input().split())

if a == "H" and b == "H":
    print("H")
if a == "H" and b == "D":
    print("D")
if a == "D" and b == "H":
    print("D")
if a == "D" and b == "D":
    print("H")
N,K,X,Y=map(int,input().split())
cost=K*X+(N-K)*Y
print(cost)

### FIXED CODE ###

N=int(input())
K=int(input())
X=int(input())
Y=int(input())
cost=N*X-(X-Y)*(max(N-K,0))
print(cost)
N,K = list(map(int,input().split())
h = list(map(int,input().split()))
ans = 0
for i in range(N):
  if h[i] >= K:
    ans += 1
print(ans)

### FIXED CODE ###

N,K = list(map(int,input().split()))
h = list(map(int,input().split()))
ans = 0
for i in range(N):
  if h[i] >= K:
    ans += 1
print(ans)
o = str(input())
s = str(input())
n = ""

if not len(o) == len(s):
	for i in range(min(len(o),len(s))):
		n += o[i]
		n += s[i]

	if len(o) > len(s):
		n += o[len(o)-1]

	if len(s) > len(o):
		n += s[len(s)-1]

else:
	for i in rage(len(o)):
		n += o[i]
		n += s[i]
		
print(n)


### FIXED CODE ###

o = str(input())
s = str(input())
n = ""

if not len(o) == len(s):
	for i in range(min(len(o),len(s))):
		n += o[i]
		n += s[i]

	if len(o) > len(s):
		n += o[len(o)-1]

else:
	for i in range(len(o)):
		n += o[i]
		n += s[i]
		
print(n)
import sys
import math
w, h, x, y = map(int, sys.stdin.readline().split())

d = [None for i in range(4)]
d[0] = abs(x*1+y*(-1)+w*h)/math.sqrt(1**2 + (-1)**2)
d[1] = abs(x*(-h/w)+y*(-1)+h)/math.sqrt((-h/w)**2 + (-1)**2)
d[2] = abs(x-w*0.5)
d[3] = abs(y-h*0.5)

if int(w-2*x)==0 and int(h-2*y)==0:
  print(w*h/2.0, 1)
  exit()
elif int(w-2*x)==0 or int(h-2*y)==0:
  print(w*h/2.0, 0)
  exit()

if int(d1) == 0 or int(d2) == 0:
  print(1,1)
  eixt()
  if int(w-2*x)==0 and int(h-2*y)==0:
    print(w*h/2.0, 1)
  else:
    print(w*h/2.0, 0)
elif d.index().min(d) == 0:
  if x > 0.5*w:
    if y < h/w*x:
      print((x*w*w)/y*0.5, 0)
    else:
      print((x*h*h)/y*0.5, 0)
  else:
    b = h - (h-y)/(w-x)*w
    if y < h/w*x:
      print(h*(w-b*(w-x)/(h-y))*0.5, 0)
    else:
      print(w*(h-b)*0.5, 0)
elif d.index().min(d) == 1:
  if int(d[0]-d[1]) == 0:
    casenum = 1
  else:
    casenum = 0
    
  if x > 0.5*w:
    if  y > -h/w*x+h:
      print(w*(-(y-h)*w/x)*0.5, casenum)
    else:
      print(h*x*h/(h-y)*0.5, casenum)
  else:
    b = (h + y*w/(x-w)) * (x-w)/y
    if  y > -h/w*x+h:
      print(h*(w-(b-h)*x/(y-h))*0.5, casenum)
    else:
      print(w*(h-b)*0.5, casenum)
elif d.index().min(d) == 2:
  if y > 0.5*h:
    b = w*y/(w-2*x)
    x1=(x-0.5*w)/y*(b-h)
    if x > 0.5*w:
      print(h*(0.5*w+w-x1)*0.5, 0)
    else:
      print(h*(0.5*w+0.5*w-x1)*0.5, 0)
  else:
    b = h - 0.5*w*y/(x-0.5*w)
    x1=b*y/(0.5*w-x)
    if x > 0.5*w:
      print(0.5*h(0.5*w+w-x1), 0)
    else:
      print(0.5*h(0.5*w+0.5*w-x1), 0)    
elif d.index().min(d) == 3:
  if int(d[2]-d[3]) == 0:
    casenum = 1
  else:
    casenum = 0
  if x > 0.5*w:
    if y > 0.5*h:
      print(0.5*w*(0.5*h+h-(y-0.5*h)/x*w+0.5*h), casenum)
    else:
      print(0.5*w*(0.5*h+0.5*h-(y-0.5*h)/x*w+0.5*h), casenum)
  else:
    if y > 0.5*h:
      print(0.5*w*(0.5*h+h-(0.5*h-w*(y-0.5*h)/(x-w))), casenum)
    else:
      print(0.5*w*(0.5*h+0.5*h-(0.5*h-w*(y-0.5*h)/(x-w))), casenum)    

### FIXED CODE ###

import sys
import math
w, h, x, y = map(int, sys.stdin.readline().split())
S = w*h/2

if x == w/2 and y == h/2:
  print(S,1)
else:
  print(S, 0)
import numpy as np
n,m = map(int, input().split())

routes = []
for i in range(m):
    route = list(map(int, input().split()))
    routes.append(route)

for i in range(m):
    routes[i] = routes[i] - np.ones(2) #道の番号をずらす

rooms = np.zeros(n) # 行ってない部屋は0、行った部屋は1
marks = np.zeros(n) # 部屋におく道標
roomsrate = [[0]] # １回目、２回目、３回目…に行ける部屋
rooms[0] = 1
marks[0] = 1

for i in range roomsrate:
    newrate = []
    for j in range roomsrate[i]: # i回目に行ける部屋を調べる
        for k in range(m):
            a = int(routes[k][0])
            b = int(routes[k][1]) 
            if (j == a or j == b):
                if (int(rooms[b]) == 0):
                    rooms[b] = 1
                    marks[b] = a
                    newrate.append(b)
                elif (int(rooms[a]) == 0):
                    rooms[a] = 1
                    marks[a] = b
                    newrate.append(a)
    roomsrate.append(newrate)
    if(newrate == [])
    break


if(np.all(rooms) == True):
    print('Yes')
    for i in range(1,n):
        print(str(int(marks[i]) + 1))

else:
    print('No')

### FIXED CODE ###

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

routes = [[] for i in range(n)]
for i in range(m):
    x,y = map(int, input().split())
    routes[x-1].append(y-1)
    routes[y-1].append(x-1)


rooms = [0 for i in range(n)] # 行ったら1,まだなら0
marks = [0 for i in range(n)] # 部屋におく道標
rooms_rate = [[0]] # ０回目、１回目、２回目、３回目…に行ける部屋
rooms[0] = 1

turn = 0
for i in rooms_rate:
    newrate = []
    for j in rooms_rate[turn]: #(turn)回目に行けた部屋から行ける部屋を調べる
        for k in routes[j]: 
            if (rooms[k] == 0): #行ったことのない部屋なら
                rooms[k] = 1
                marks[k] = j # 道標をセット
                newrate.append(k)
    rooms_rate.append(newrate)
    if (len(newrate) == 0): #新しく行けなくなったら終わり
        break
    turn = turn + 1


if(all(rooms) == True):
    print('Yes')
    for i in range(1,n):
        print(str(int(marks[i]) + 1))

else:
    print('No')
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
B = list(map(int, input().split()))
B.sort(reverse=True)
C = list(map(int, input().split()))
C.sort(reverse=True)
count = [0]*N
answer = 0
z = 0
for i in range(N):
    if B[N-1] >= C[i]:
        break
    z += 1
count[N-1] = z
for i in range(1, N):
    for j in range(z):
        if B[N-1-i] < C[z-1-j]:
            break
        else:

            z -= 1
    count[N-1-i] = z
sum_matrix = [0]*(N+1)
y = 0
for i in range(N):
    sum_matrix[i+1] = sum_matrix[i] + count[i]
for i in range(N):
    if A[N-1] >= B[i]:
        break
    answer += count[i]
    y += 1

for i in range(1, N):
    for j in range(y):
        if A[N-1-i] < B[y-1-j]:
            break        
    y -= j
    answer += sum_matrix[y]
    #print(y)
    #print(answer)
#print(count)
#print(sum_matrix)
print(answer)

### FIXED CODE ###

import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
B = list(map(int, input().split()))
B.sort(reverse=True)
C = list(map(int, input().split()))
C.sort(reverse=True)
count = [0]*N
answer = 0
z = 0
for i in range(N):
    if B[N-1] >= C[i]:
        break
    z += 1
count[N-1] = z
for i in range(1, N):
    k=z
    for j in range(k):
        if B[N-1-i] < C[k-1-j]:
            break
        else:
            z -= 1      
    count[N-1-i] = z
sum_matrix = [0]*(N+1)
y = 0
for i in range(N):
    sum_matrix[i+1] = sum_matrix[i] + count[i]
for i in range(N):
    if A[N-1] >= B[i]:
        break
    answer += count[i]
    y += 1
for i in range(1, N):
    x = y
    for j in range(x):
        if A[N-1-i] < B[x-1-j]:
            break        
        y -= 1
    answer += sum_matrix[y]
print(answer)
from itertools import groupby

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

li = []

for key, value in groupby(s):
    li.append((key,len(list(value))))

x_li = []
y_li = []

now = 0
for i in li:
    if i[0] == "F":
        if now%2 == 0:
            x_li.append(i[1])
        else:
            y_li.append(i[1])
    else:
        now += i[1]

x_flag = False
y_flag = False

def possible(n,now,final,li):
    global x_flag,y_flag
    if n == len(li):
        if now == final:
            if li == x_li:
                x_flag = True
            else:
                y_flag = True
    else:
        return possible(n+1,now-li[n],final,li),possible(n+1,now+li[n],final,li)

possible(0,0,x,x_li)
possible(0,0,y,y_li)

if x_flag and y_flag:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from itertools import groupby
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

s = input()

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

d = [len(i) for i in s.split('T')]

x_li = d[2::2]
y_li = d[1::2]

now_x = [0]
now_y = [0]

x -= d[0]

for i in x_li:
    nx = set()
    for j in now_x:
        nx.add(j-i)
        nx.add(j+i)
    now_x = nx

for i in y_li:
    ny = set()
    for j in now_y:
        ny.add(j-i)
        ny.add(j+i)
    now_y = ny

if x in now_x and y in now_y:
    print("Yes")
else:
    print("No")
n = input()
x = {'S':[], 'H':[], 'C':[], 'D':[]}
for i in range(n):
    a = raw_input().split()
    x[a[0]].append(int(a[1]))
for key in ['s', 'H', 'C', 'D']:
    for i in range(13):
        for j in x[key]:
            if i+1 == j: break
        else: print key, i+1

### FIXED CODE ###

n = input()
x = {'S':[], 'H':[], 'C':[], 'D':[]}
for i in range(n):
    a = raw_input().split()
    x[a[0]].append(int(a[1]))
for key in ['S', 'H', 'C', 'D']:
    for i in range(13):
        for j in x[key]:
            if i+1 == j: break
        else: print key, i+1
N, Q=map(int,input().split())
S=input()
t=[0]*(N+1)
for i in range(N):
  t[i+1]=t[i]+(1 if S[i : i+2]== AC else 0)
for i in range(Q):
  l, r=map(int,input().split())
  print(t[r-1]-t[l-1])

### FIXED CODE ###

N, Q=map(int,input().split())
S=input()
t=[0]*(N+1)
for i in range(N):
  t[i+1]=t[i]+(1 if S[i : i+2]== 'AC' else 0)
for i in range(Q):
  l, r=map(int,input().split())
  print(t[r-1]-t[l-1])
L, R = [int(i) for i in input().split(" ")]

flag=True
if (R - L) >= 2019:
  print(0)
else:
  min_mod = 2020
  for i in range(L, R):
    for j in range(i+1, R+1):
      tmp = (i*j) % 2019
      if tmp == 0:
        print(0)
        flag=False
        break
      elif tmp < min_mod:
        min_mod = tmp

if (flag):
  print(min_mod)

### FIXED CODE ###

L, R = [int(i) for i in input().split(" ")]

flag=True
if (R - L) >= 2019:
  flag=False
  print(0)
else:
  min_mod = 2019
  for i in range(L, R):
    for j in range(i+1, R+1):
      tmp = (i*j) % 2019
      if tmp == 0:
        print(0)
        flag=False
        break
      elif tmp < min_mod:
        min_mod = tmp
    if flag==False:
      break

if flag==True:
  print(min_mod)
# coding: utf-8

a=input()
b=input()

if int(a)*int(b)%2==0:
    print('Even')
else:
    print('Odd')

### FIXED CODE ###

def main():
    a, b = [int(_) for _ in input().split()]
    print("Even") if a * b % 2 == 0 else print("Odd")

main()
p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)
else:
    print(q+r)



### FIXED CODE ###

p,q,r=map(int,input().split())
if p>=q and p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(q+p)
#s[0]ってするとsの1つ目を示すらしい・・・だから
ｓ=input()

if s[0] == s[1]:
    print('Bad')
if s[1] == s[2]:
    print('Bad')    
if s[2] == s[3]:
    print('Bad')
else:
    print(Good')

### FIXED CODE ###

s=input()

if s[0] == s[1]:
    print('Bad')
    exit()
if s[1] == s[2]:
    print('Bad')   
    exit()
if s[2] == s[3]:
    print('Bad')
    exit()
else:
    print('Good')
n,*a=map(int,open(0).read().split());print(asorted((abs(a[i]-sum(a)/n),i)for i in range(n))[0][1])

### FIXED CODE ###

n,*a=map(int,open(0).read().split());print(sorted((abs(a[i]-sum(a)/n),i)for i in range(n))[0][1])
import sys
n, k = [int(i) for i in sys.stdin.readline().split()]
v_ls = [int(i) for i in sys.stdin.readline().split()]
right_memo_ls = [[0 for i in range(k)]for j in range(k)]
left_memo_ls = [[0 for i in range(k)]for j in range(k)]
right_memo_ls[0][0] = 0
left_memo_ls[0][0] = 0
INF = 1e10
right_cost2val = {i : -INF for i in range(1+k)}
left_cost2val = {i : -INF for i in range(1+k)}
right_cost2val[0] = 0
left_cost2val[0] = 0
for i in range(k):
    for j in range(0, min(k - i, i + 2)):
        if j == 0:
            right_memo_ls[i][j] = right_memo_ls[max(0,i-1)][j] + v_ls[i]
            left_memo_ls[i][j] = left_memo_ls[max(0,i-1)][j] + v_ls[-i - 1]
        elif j == i+1:
            right_memo_ls[i][j] = 0
            left_memo_ls[i][j] = 0
        else:
            right_memo_ls[i][j] = max(right_memo_ls[max(0, i-1)][max(0, j-1)], right_memo_ls[max(0, i-1)][j] + v_ls[i])
            left_memo_ls[i][j] = max(left_memo_ls[max(0, i-1)][max(0, j-1)], left_memo_ls[max(0, i-1)][j] + v_ls[-i-1])
        right_cost2val[i + j + 1] = max(right_cost2val[i + j + 1], right_memo_ls[i][j])
        left_cost2val[i + j + 1] = max(left_cost2val[i + j + 1], left_memo_ls[i][j])


best = -INF
for i in range(k+1):
    for j in range(k+1-i):
        score = right_cost2val[i] + left_cost2val[j]
        if best < score:
            best = score
print(best)

### FIXED CODE ###

import sys
n, k = [int(i) for i in sys.stdin.readline().split()]
v_ls = [int(i) for i in sys.stdin.readline().split()]
inv_v_ls = v_ls[::-1]
sum_a_b = min(n, k) + 1
best = 0
for a in range(sum_a_b):
    for b in range(sum_a_b - a):
        ls = v_ls[:a] + inv_v_ls[:b]
        ls.sort()
        for c in range(k + 1 - a - b):
            if c >= len(ls):
                break
            score = sum(ls[c:])
            if score > best:
                best = score
            if ls[c] > 0:
                break
print(best)
S=[]
for char in '000':
  S.append(char)

#route 2
C2=0
for n in range(int(len(S))+1):
  if n%2==0:
    if S[n]==0:
      S[n]=1
      C2+=1
  else:
    if S[n]==1:
      S[n]=0
      C2+=1
      
#route 1
C1=0
for i in range(int(len(S))+1):
  if i%2==0:
    if S[i]==1:
      S[i]=0
      C1+=1
  else:
    if S[i]==0:
      S[i]=1
      C1+=1

if C1>=C2:
  print(C1)
else:
  print(C2)

  
    
    
      

### FIXED CODE ###

S=[]
for char in input():
  S.append(char)
#route 1
C1=0
for i in range(len(S)):
  if i%2==0:
    if S[i]=='1':
      C1+=1
  else:
    if S[i]=='0':
      C1+=1

#route 2
C2=0
for n in range(len(S)):
  if n%2==0:
    if S[n]=='0':
      C2+=1
  else:
    if S[n]=='1':
      C2+=1

if C2>=C1:
  print(C1)
else:
  print(C2)
import numpy as np

n=input()
a=list(map(int,input().split()))
a=np.array(a,dtype="float64")
ans=np.prod(a)

if ans>10**18:
  print(-1)
else:
  print(int(ans))

### FIXED CODE ###

n=input()
A=list(map(int,input().split()))
ans=1
if A.count(0)==0:
  for i in A:
    ans*=i
    if ans>10**18:
      ans=-1
      break
else:
  ans=0
print(ans)
a,b = int(raw_input().split())
if a > b:
  print 'a > b'
elif (a == b):
  print 'a == b'
else:
  print 'a < b'

### FIXED CODE ###

a,b = map(int, raw_input().split())
if a > b:
  print 'a > b'
elif (a == b):
  print 'a == b'
else:
  print 'a < b'
n=int(input())
s=list(input())
d=0
for i in range(n):
  if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
    d+=1
  
print(d)    


### FIXED CODE ###

n=int(input())
s=list(input())
d=0
for i in range(n):
  if n-(i+1)>=2:
    if s[i]=='A' and s[i+1]=='B' and s[i+2]=='C':
      d+=1
  else:
    pass
print(d)
N=int(input())
    lis=list(map(int,input().split()))
    lis.sort()
    sum=0
    while(len(lis)>1):
        v=lis.pop()
        k=1
        while k<=v:
            k*=2
        m=k-v
        if m in lis:
            sum+=1
            lis.remove(m)

    print(sum)

### FIXED CODE ###

from collections import Counter
if __name__ == "__main__":
    N=int(input())
    lista=list(map(int,input().split()))
    mii=Counter(lista)
    si=set(lista)
    listb=[i for i in si]
    listb.sort()
    ans=0
    while(len(listb)>0):
        x=listb.pop()
        if mii[x]>0:
            k=1
            while k<=x:
                k*=2
            y=k-x
            if x==y:
                ans+=mii[x]//2
            elif y<x and y in si:
                m=min(mii[x],mii[y])
                ans+=m
                mii[y]-=m
            mii[x]=0
    print(ans)
int N = int(input())
int a = int(input())
int b = int(input())
if N == 1:
    print("Hello World")
else:
    print(a+b)

### FIXED CODE ###

N = int(input())
if N == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a+b)
n = int(inout())
if n//100 == n%10:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

n = int(input())
if n//100 == n%10:
  print('Yes')
else:
  print('No')
def readInts():
  return list(map(int, input(), split()))

n, m = readInts()
a = readInts()
s = sum(a)
cnt = 0
for i in range(n):
  if a[i]*4*m >=s:
    cnt +=1
    
if cnt >= m:
  print("Yes")
else:
  print("No")
  


### FIXED CODE ###

def readInts():
  return list(map(int, input().split()))

n, m = readInts()
a = readInts()
s = sum(a)
cnt = 0
for i in range(n):
  if a[i]*4*m >=s:
    cnt +=1
    
if cnt >= m:
  print("Yes")
else:
  print("No")
n = int(input())
h = list(map(int, input().split()))
h.append(inf)
ans = []
x = 0
for i in range(n - 1):
  ans.append(0)
  while h[i] - h[i + 1] >= 0:
    ans[x] += 1
    i += 1
  x += 1
print(max(ans))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
i = 0
count = 0
ans = []
while i < n - 1:
  if h[i] < h[i + 1]:
    ans.append(count)
    count = 0
  else:
    count += 1
  i += 1
ans.append(count)
print(max(ans))
s = input()

a = s[1]
b =len( s[2:len(s)-1])
c = s[-1]

print(a+b+c)


### FIXED CODE ###

s = input()

a = s[0]
b =len(s)-2
c = s[-1]

print( str(a) + str(b) + str(c))
n = int(input())
li = list(map(int,input().split()))

for i in range(n):
    sum += li[i]

judge = sum - max(li) -max(li)

if judge > 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

sum = 0

for i in range(n):
    sum = sum + lis[i]

judge = sum - max(lis) - max(lis)

if judge > 0:
    print("Yes")
else:
    print("No")
#from functools import lru_cache
import sys
import math
def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))

def rvfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:rvfunc(f)(*x,**kwargs) if all(vfunc(lambda y:isinstance(y,list))(x)) else f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())

ls = rvfunc(int)(reader())
n,k=ls[0]
a=ls[1]

def reqk(l):
    return sum(vfunc(lambda aa:math.ceil(aa/float(l))-1)(a))
def binary_search(imin=None,imax=None):
    if [imin,imax]==[None]*2: imin,imax=0,10**9+1
    if (imax < imin):
        return imin
    else:
        imid = int(imin + (imax - imin) / 2)
        if (reqk(imid)<=k):return binary_search(imin, imid - 1)
        elif (reqk(imid)>k):return binary_search(imid + 1, imax)
        else:return imid
print(binary_search() if k!=0 else max(a))


### FIXED CODE ###

#from functools import lru_cache
import sys
import math
def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))
def rvfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:rvfunc(f)(*x,**kwargs) if all(vfunc(lambda y:isinstance(y,list))(x)) else f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())
sys.setrecursionlimit(100000)
ls = rvfunc(int)(reader())
n,k=ls[0]
a=ls[1]

def reqk(l):
    return sum(vfunc(lambda aa:math.ceil(aa/float(l))-1)(a))
def binary_search(imin=None,imax=None):
    if [imin,imax]==[None]*2: imin,imax=1,10**9+1
    if (imax < imin):
        return imin
    else:
        imid = int(imin + (imax - imin) / 2)
        if (reqk(imid)<=k):return binary_search(imin, imid - 1)
        elif (reqk(imid)>k):return binary_search(imid + 1, imax)
print(binary_search() if k!=0 else max(a))
s = input()[::-1]
p = 0
dp = [0] * 2019
dp[0] = 1
for i in s:
    p = (p + (int(s) * (10 ** (i)))) % 2019
    dp[p] += 1
ans = 0
for i in dp:
    ans += i * (i - 1) // 2
print(ans)

### FIXED CODE ###

s = input()[::-1]
p = 0
dp = [0] * 2019
dp[0] = 1
d = 1
for i in s:    
    p = (int(i) * d + (p)) % 2019
    dp[p] += 1
    d *= 10
    d = d % 2019
ans = 0
for i in dp:
    ans += i * (i - 1) // 2
print(ans)
(h,n),*t=[[*map(int,t.split())]for t in open(0)]
d=[0]*h*n
for i in range(h):d[i+1]=min(b+d[i-a+1]for a,b in t)
print(d[h])

### FIXED CODE ###

h,n,*t=map(int,open(0).read().split())
dp=[10**18]*(h+1)
dp[0]=0
for a,b in zip(*[iter(t)]*2):
    for j in range(h+1):
        dp[j]=min(dp[j],dp[max(0,j-a)]+b)
print(dp[h])
import sys
n,k = map(int,input().split())
l = list(map(int,input().split()))
if n <= k:
    print("0")
    sys.exit()
l = sorted(l,reverse = True)
for i in range(k):
    l.remove(l[i])
a = 0
for j in l:
    a += j
print(a)

### FIXED CODE ###

import sys
n,k = map(int,input().split())
l = list(map(int,input().split()))
if n <= k:
    print("0")
    sys.exit()
l = sorted(l,reverse = True)
hissatu = 0
for i in range(k):
    hissatu += l[i]
total = 0
for j in l:
    total += j
print(total-hissatu)
N, K = map(int, input().split())
A = list(map(int, input().split()))

nums = A[:]

sum_n = sum(nums)

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

divisors = sorted(list(make_divisors(sum_n)), reverse=True)
#print('DIV', divisors)


for d in divisors:
    mod_nums = list(map(lambda x: x%d, nums[:]))
    mod_nums = sorted(mod_nums)
    #print(mod_nums)
    x = 10**10
    for i in range(1, len(mod_nums)):
        if sum(mod_nums[:i]) == sum(list(map(lambda x: d-x, mod_nums[i:]))):
            x = sum(mod_nums[:i])
            break
    #print(d, x)
    if x <= K:
        ans = d
        break
            
        
        



print(ans)

### FIXED CODE ###

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

nums = A[:]

sum_n = sum(nums)

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

divisors = sorted(list(make_divisors(sum_n)), reverse=True)
#print('DIV', divisors)


for d in divisors:
    mod_nums = list(map(lambda x: x%d, nums[:]))
    mod_nums = sorted(mod_nums)
    #print(mod_nums)
    x = 10**10
    for i in range(0, len(mod_nums)+1):
        if sum(mod_nums[:i]) == sum(list(map(lambda x: d-x, mod_nums[i:]))):
            x = sum(mod_nums[:i])
            break
    #print(d, x)
    if x <= K:
        ans = d
        break
            
print(ans)