peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
x_list = [int(x) for x in input().split()]
temp_list = [[], []]
for i in range(3):
    temp_list[x_list[i] % 2].append(i)
temp = len(temp_list[0])
ans = 0
if temp == 1:
    x_list[temp_list[1][0]] += 1
    x_list[temp_list[1][1]] += 1
    ans += 1
elif temp == 2:
    x_list[temp_list[0][0]] += 1
    x_list[temp_list[0][1]] += 1
    ans += 1
x_max = max(x_list)
ans += sum([gap // 2 for gap in [x_max - x for x in x_list]])
print(ans)
# Judge status: Wrong Answer
s = str(input())
n = int(input())
for i in s:
    if i != "1":
        print(i)
        break
# Judge status: Accepted
X,N = [int(_n) for _n in input().split()]
P = [int(_n) for _n in input().split()]
res = 0
for i in range(102):
    if i in P:
        continue
    if abs(X - i) < abs(X - res):
        res = i
print(res)
# Judge status: Wrong Answer
def solve():
    N = int(input())
    array = list(map(int, input().split()))
    if array == list(set(array)):
        print("YES")
    else:
        print("NO")

solve()
# Judge status: Accepted
S=str(input())
T=''
for i in range(len(S)):
    if S[i]=='0' or S[i]=='1':
        T+=S[i]
    else:
        T=T[:-1]
print(T)
# Judge status: Wrong Answer
x = int(input())
y = list(map(int, input().split()))

y.sort()
ans = []
while len(y) != 0:
    judge = y.pop(0)
    remove = []
    if len(y) == 0:
        ans.append(judge)
        break;
    if judge != y[0]:
        ans.append(judge)
    for i in y:
        if i % judge == 0:
            remove.append(i)
    y = list(set(y) - set(remove))
        
print(len(ans))
# Judge status: Accepted
ABC = input()
ABC = list(ABC.split())

A = int(ABC[0])
B = int(ABC[1])
C = int(ABC[2])

if A+B >= C:
  print('Yes')
else:
  print("No")
# Judge status: Accepted
N=int(input())
print(N+N**2+N**3)
# Judge status: Accepted
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
t,a = iim()
H = iil()
mdif = 10**9
ans = 0
for i,item in enumerate(H):
    tem = t - item*0.006
    if abs(tem - a) < mdif:
        ans = i+1
        mdif = abs(tem - a)
print(ans)
# Judge status: Accepted
N=int(input())
A = list(map(int,input().split()))
str="APPROVED"

for item in A:
  if item%2==0:
    if item%3!=0 and item%5 !=0:
      str = "DENIED"
      
print(str)
# Judge status: Wrong Answer
n,k,s = map(int,input().split())

ans=[]

cnt=n-k
for i in range(cnt):
    ans.append(s)

for j in range(n-k):
    if s==1:
        ans.append(2)
    elif s==10**9:
        ans.append((10**9)-1)
    else:
        ans.append(s+1)


print(*ans)
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
counter = Counter(a)
result = 0
for num, c in counter.items():
    if c > num:
        result += c - num
    elif c < num:
        result += c
print(result)
# Judge status: Accepted
import math

H1,M1,H2,M2,K=map(int,input().split())
T=(H2*60+M2)-(H1*60+M1)
if T-K<=0:
    T=0
else:
    T=T-K
print(T)
# Judge status: Accepted
a, b, m = map(int, input().split())
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
min_cost = min(a_list) + min(b_list)

for _ in range(m):
    x, y, c = map(int, input().split())
    _a = a_list[x-1]
    _b = b_list[y-1]
    cost = _a + _b - c
    min_cost = min(cost, min_cost)
print(min_cost)
# Judge status: Wrong Answer
s=input()
print(s[:2]+'8'+s[4:])
# Judge status: Accepted
s = input()

ss = s.split()

print(ss[0][0]+ss[1][0]+ss[2][0])
# Judge status: Wrong Answer
x,k,d=map(int,input().split())
while k!=0:
    if x-d==0:
        if k%2 ==0:
            break
        else:
            x=x-d
            break
    if x-d < 0 :
        if abs(x-d)<x:
            x=abs(x-d)
            break
        else:
            break
    else :
        x=x-d
        k=k-1
print (x)
# Judge status: Accepted
N,A,B = map(int, input().split())
if N // (A + B) == 0:
    print(min(A, N))
else:
    print((N // (A + B)) * A + min((N % (A + B)), A))
# Judge status: Wrong Answer
import sys
import math
from collections import deque
input = sys.stdin.readline
N, K = map(int,input().split())
H = list(map(int,input().split()))
ans = 0
for i in range(N-K):
    ans += H[i]
print(ans)
# Judge status: Accepted
x,y = map(int,input().split())

a = [1, 3, 5, 7, 8, 10, 12]
b = [4, 6, 9, 11]

if x in a and y in a:
  	print("Yes")
elif x in b and y in b:
  	print("Yes")
else:
  	print("No")
# Judge status: Wrong Answer
import math

def searchPrimeNum(N):
    maxV=int(math.sqrt(N))
    searchList=[i for i in range(2, N+1)]
    primeNum=[]
    while searchList[0]<=maxV:
        primeNum.append(searchList[0])
        tmp=searchList[0]
        searchList=[i for i in searchList if i%tmp!=0]
    primeNum.extend(searchList)
    return primeNum

A, B=map(int, input().split())
primeNum=searchPrimeNum(int((max(A, B)**0.5)+10))
ans=1
for p in primeNum:
    if p*p>min(A, B):
        break
    if A%p==0 and B%p==0:
        ans+=1
print(ans)
# Judge status: Wrong Answer
from math import sqrt,floor
N,M =map(int,input().split())
ans = 1
for g in range(1,floor(sqrt(M))+1):
    if M%g == 0:
        x = M//g
        if x > floor(sqrt(M)) and g >= N:
            ans = x
        if x >= N:
            ans = g
print(ans)
# Judge status: Wrong Answer
A, B, C = map(int,input().split())
print(C-(A-B))
# Judge status: Accepted
S = list(input())
N = int(input())

'''
ordの位置
#z = 122
#a = 97
左の文字からNで'a'に出来るかを確認
aに出来るならaにして使った分をNから引く
繰り返して行き一番最後にあまりをすべて使う
'''
  
for i, s in enumerate(S):
  if ord(s) - 97 > 0  and 122 - ord(s) < N:
    S[i] = "a"
    N -= 123 - ord(s)
else:
  S[i] = chr(N % 26 + ord(S[i])) # ここのWAは反省する
       
print("".join(S))
# Judge status: Accepted
N = int(input())
if N < 105:
  print(0)
elif 105 <= N < 135:
  print(1)
elif 135 <= N < 165:
  print(2)
elif 165 <= N < 189:
  print(3)
elif 189 <= N < 195:
  print(4)
else:
  print(5)
# Judge status: Accepted
a, b, c = map(int, input().split())
k = int(input())

if b > a:
  multiplier = 2 ** k
  if c * multiplier > b:
    ans = 'Yes'
  else:
    ans = 'No'
else:
  while b <= a:
    b *= 2
    k -= 1
  multiplier = 2 ** k
  if c * multiplier > b:
    ans = 'Yes'
  else:
    ans = 'No'

print(ans)
# Judge status: Accepted
# D - Triangles

from bisect import bisect_left

N = int(input())
L = sorted([int(l) for l in input().split()])

cnt = 0
for i in range(N):
    for j in range(i + 1, N):
        cnt += bisect_left(L, L[i] + L[j]) - (j + 1)

print(cnt)
# Judge status: Wrong Answer
#!/usr/bin/env python3
import sys
# input = sys.stdin.r/eadline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))

def main():
    N = INT()
    A = LI()
    A.sort()

    print(sum(A[N:2*N]))

if __name__ == '__main__':
    main()
# Judge status: Accepted
from collections import deque
S = deque(input())
N = int(input())
is_inversed = False
for i in range(N):
    Q = input()
    if Q[0] == '1':
        is_inversed = not (is_inversed)
    else:
        if (Q[2] == '1' and is_inversed) or (Q[2] == '2' and not (is_inversed)):
            S.append(Q[4])
        else:
            S.appendleft(Q[4])
if is_inversed:
    print(''.join(list(S)[::-1]))
else:
    print(''.join(S))
# Judge status: Accepted
#coding: utf-8
import math
import heapq
import bisect
import numpy as np
from collections import Counter
#from scipy.misc import comb
 
N,K = map(int, input().split())
 
# 複数個の数値を、intの配列として取得
X = list(map(int, input().split()))
 
ans = 10**18
for i in range(N-K+1):
    if X[i]*X[i+K-1] >= 0:
        ans = min(ans,max(abs(X[i]),abs(X[i+K-1])))
    else:
        ans = min(ans, 2*abs(X[i])+abs(X[i+K-1]), abs(X[i])+2*abs(X[i+K-1]))
 
print(ans)
# Judge status: Accepted
n = int(input())
an = list(map(int, input().split()))
classify = [0 for i in range(3)]
#4の倍数、2の倍数、奇数
for i in range(len(an)):
    if an[i] % 4 == 0:
        classify[0] += 1
    elif an[i] % 2 == 0:
        classify[1] += 1
    else:
        classify[2] += 1
if classify[1]==0:
    if(classify[0]+1) < classify[2]:
        print("No")
    else:
        print("Yes")

elif (classify[0]) < classify[2]:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
s=list(map(ord,list(input())))
k=int(input())

for i in range(len(s)):
    s[i]-=97

c=0
while k>0:
    if c==len(s)-1:
        s[c]=(s[c]+k)%26
        k=0
    elif s[c]==0:
        c+=1
    elif s[c]+k>=26:
        k-=26-s[c]
        s[c]=0
        c+=1
    else:
        c+=1

seq=""
for i in range(len(s)):
    seq+=chr(s[i]+97)

print(seq)
# Judge status: Accepted
N,C,K = map(int,input().split())

T = sorted([int(input()) for _ in range(N)])
ans = 1
count = 0
time = 0
start = -1
for i in range(N):
  if start == -1:
    start = i
  if i != N-1:
    if T[i+1] > T[start] + K or i+1 -start == C:
      ans += 1
      start = -1
  
print(ans)
# Judge status: Accepted
X,Y=map(int,input().split())
if 2*Y<X or 2*X<Y:
  print(0)
  exit()
if not((X%3==0 and Y%3==0) or (X%3==1 and Y%3==2) or (X%3==2 and Y%3==1)):
  print(0)
  exit()
P=10**9+7
A=(2*Y-X)//3
B=(2*X-Y)//3
num = 1
for i in range(A+1, A+B+1):
  num=num*i%P
den = 1
for j in range(1, B+1):
  den = den*j%P
den = pow(den,P-2,P)
print((num*den)%P)
# Judge status: Wrong Answer
a=int(input())
b=int(input())
l=[]
l.append(a)
l.append(b)
if '1' not in l:
  print(1)
elif '2' not in l:
  print(2)
else:
  print(3)
# Judge status: Accepted
def solve():
  n, m = map(int, input().split())
  if m//2 <= n:
    print(m//2)
  else:
    ans = 0
    ans += n
    m = m-n*2
    ans += m//4
    print(ans)
  return 0
 
if __name__ == "__main__":
  solve()
# Judge status: Wrong Answer
d=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for _ in range(d)]

for i in range(365):
    print(i%26)
# Judge status: Accepted
n = int(input())
ab = [list(map(int, input().split())) for i in range(n)][::-1]

ans = 0
for a, b in ab:
    a += ans
    # 負の剰余。
    ans += -a % b
print(ans)
# Judge status: Accepted
MOD = 10**9 + 7
 
import math
print(math.factorial(int(input()))%MOD)
# Judge status: Accepted
s = input()
n = len(s)
ans = 1e100
for i in range(n-2):
  ans = min(ans, abs(753 - int(s[i:i+3])))
print(ans)
# Judge status: Accepted
import math
 
a,b,c,d=map(int,input().split())
 
n=b-a+1
 
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
  
x=lcm(c,d)
 
cc=b//c-(a-1)//c
dc=b//d-(a-1)//d
xc=b//x-(a-1)//x
 
print(n-cc-dc+xc)
# Judge status: Wrong Answer
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

def main():
    L, R = input_nums()
    MOD = 2019
    a = L%MOD
    b = R%MOD
    if a < b:
        print((a*(a+1))%MOD)
    else:
        print(0)

if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
input = sys.stdin.readline

N, M = map(int, input().split())

G = [tuple(map(int, input().split())) for _ in range(M)]
G.sort(key = lambda x: x[0])

check = [False] * (N + 1)

for a, b in G:
    if a == 1:
        check[b] = True
    else:
        if check[a] and b == N:
            print ('POSSIBLE')
            exit()

print ('IMPOSSIBLE')
# Judge status: Wrong Answer
S = input('')
if S == "Sunny":
    print ('cloudy')
elif S == "Cloudy" :
    print ('Rainy')
else :
    print ('Sunny')
# Judge status: Wrong Answer
def Base_10_to_n(X, n):
   #print(X)
   if (int(X/n)):
      return Base_10_to_n(int(X/n), n)+' '+str(X%n)
   return str(X%n)
n = int(input()) -1
an = Base_10_to_n(n,26)
ans = [chr(int(i)+96) for i in an.split()]
if len(ans)>1:
   ans[-1] = chr(ord(ans[0-1]) +1)
print(''.join(ans))
# Judge status: Accepted
X , Y = map(int,input().split())
cnt = 0
while True:
	if X <= Y:
		cnt+=1
		X *= 2
	else:
		break
print(cnt)
# Judge status: Accepted
n=int(input())
s=str(input())
ans=0
m=0
for i in range(n):
  if s[i]=="I":
    ans+=1
    m=max(m,ans)
  else:
    ans-=1

print(m)
# Judge status: Accepted
def hoge():
  dp = [0] * (n + 5)
  for i in range(1, n):
    p = [dp[j] + abs(h_list[i] - h_list[j]) for j in range(max(0, i - k), i)]
    dp[i] = min(p)
  return dp[n - 1]

def solve():
  global n, k, h_list
  n, k = map(int, input().split())
  h_list = list(map(int, input().split()))
  ans = hoge()
  print(ans)
  return 0

if __name__ == "__main__":
  solve()
# Judge status: Accepted
import itertools
n = int(input())
s = [i for i in input()]
cnt_s, cnt_d = [0]*(n+1), [0]*(n+1)
for i in range(n):
    if s[i] == "#":
        cnt_s[i+1] = 1
    else:
        cnt_d[i+1] = 1
cnt_s, cnt_d = list(itertools.accumulate(cnt_s)), list(itertools.accumulate(cnt_d))
ans = 10**6
cnt_d_l = cnt_d[-1]
for i in range(n+1):
    ans = min(ans, cnt_s[i] - cnt_s[0] + (cnt_d_l - cnt_d[i]))
print(ans)
# Judge status: Wrong Answer
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]


n = int(input())

if (n == 1):
    print(1)
else:
    l1 = 1
    l2 = 3
    ans = 0
    for i in range(n-2):
        ans = l2 + l1
        l1 = l2
        l2 = ans
    print(ans)
# Judge status: Wrong Answer
n = input(); a = 0; b = 0; c = 0
for i in range(len(n)):
    if n[i] != "9":
        if a == 0: a += 1; b = i; c = int(n[i])
        else: a += 1
if a == 0: print(9*len(n))
elif a == 1 and b == 0: print(c+9*(len(n)-1))
else: print(9*len(n)-1)
# Judge status: Accepted
#template
def inputlist(): return [int(k) for k in input().split()]
#template
S = list(input())
T = list(input())
for i in range(len(S)):
    Sa = S[:]
    S = [Sa[-1]] + Sa[:-1]
    if S == T:
        print("Yes")
        exit()
print("No")
# Judge status: Accepted
N, Y = map(int, input().split())

for a in range(Y // 10000 + 1):
    for b in range((Y - 10000 * a) // 5000 + 1):
        if a + b + (Y - 10000 * a - 5000 * b) // 1000 == N:
            print(a, b, N - a - b)
            exit()
print(-1, -1, -1)
# Judge status: Accepted
import sys
n,m,k=map(int,input().split())
for i in range(n+1):
  for j in range(m+1):
    if (i*j)+(n-i)*(m-j)==k:
      print('Yes')
      sys.exit()
print('No')
# Judge status: Accepted
s=input()
print(min(s.count('1'),s.count('0'))*2)
# Judge status: Wrong Answer
A, B = list(map(int, input().split()))

large = A if A > B else B
small = A if A < B else B

multi = small

r = large % small
while r != 0:
    multi = r
    r = small % r

print(large*small//multi)
# Judge status: Accepted
n=int(input())
if n%1000==0:
  print(0)
else:
  print(1000-(n%1000))
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
passlist = [0]*N
point = 1
depth = 0
waylist = []
while passlist[point-1] == 0:
    waylist.append(point)
    passlist[point-1] = depth
    point = A[point-1]
    depth+=1
roop = waylist[waylist.index(point):len(waylist)]
firstreach = passlist[roop[0]-1]
if K < firstreach:
  print(passlist.index(K)+1)
else:
  print(roop[(K-firstreach)%len(roop)])
# Judge status: Accepted
n = int(input())

count = 0
for i in range(1, n + 1):
    keta = len(str(i))
    if keta % 2 == 1: count += 1

print(count)
# Judge status: Accepted
a, b = map(int, input().split())
if a <= 5:
    print(0)
elif a <= 12:
    print(b//2)
else: print(b)
# Judge status: Accepted
from operator import itemgetter
import sys
input = sys.stdin.readline

n = int(input())
time = []
flag = True
now = 0

for i in range(n):
    a, b = map(int, input().split())
    time.append([a, b])

time = sorted(time, key = lambda x: x[1])

for i in range(n):
    now += time[i][0]
    if now <= time[i][1]:
        pass
    else:
        flag = False

if flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
A,B=map(int,input().split())
cnt=0
def is_pal(s):
    s_str=str(s)
    s_rev=str() 
    for i in range(1,len(str(s))+1):
        s_rev+=s_str[-i]
    
    if s_str==s_rev:
        return True
    else:
        return False
for i in range(A,B+1):
    if is_pal(i):
        cnt+=1
print(cnt)
# Judge status: Accepted
import math

a, b = (int(x) for x in input().split())
ans = 0
i = 0
ok = False

while i < 10000 :
    case_a = math.floor(i * 0.08)
    # print(case_a)
    case_b = math.floor(i * 0.10)
    # print(case_b)

    if case_a == a and case_b == b :
        
        ans = i
        ok = True
        break

    i = i + 1

if ok == False : 
    ans = -1

print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=sorted(map(int,input().split()))
c={}
for _ in range(m):
    bx, cx =map(int,input().split())
    c[cx]=bx
c_sort=sorted(c.keys(),reverse=1)

c_list=[]
for j in c_sort:
  for _ in range(c[j]):
    if len(c_list)>=n:
      break
    c_list.append(j)

c_len=len(c_list)
sum=0
for i in range(n):
    if i+1<=c_len:
        sum+=max(a[i],c_list[i])
    else:
        sum+=a[i]
print(sum)
# Judge status: Wrong Answer
S = int(input())

A = S//100
B = S%100

if A >= 13:
    if B >= 13:
        print('NA')
    elif B <13:
        if B != 0:
            print('YYMM') 
        else:
            print('NA')
elif A < 13:
    if B >= 13:
        if A != 0:
            print('MMYY')
        else:
            print('NA')
    elif B < 13:
        print('AMBIGUOUS')
# Judge status: Wrong Answer
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()

ans = []
for i in range(m-1):
  ans.append(abs(x[i+1] - x[i]))
ans.sort()
print(sum(ans[:-n+1]))
# Judge status: Accepted
s = input()
start = 0
end = 0

for x in s:
    if x == 'A':
        break
    else:
        start += 1

for x in reversed(s):
    if x == 'Z':
        break
    else:
        end += 1

print(len(s) - start - end)
# Judge status: Accepted
import itertools
import sys
import numpy as np
import collections

n=int(input())
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
ans =0
for i in range(n):
    can = a1[:i+1]+a2[i:]
    ans=max(sum(can),ans)
print(ans)
# Judge status: Accepted
n = int(input())
h = list(map(int,input().split()))
cost = [0]*n
cost[1] = abs(h[1]-h[0])
for i in range(2,n):
    cost[i] = min(cost[i-1] + abs(h[i]-h[i-1]) , cost[i-2] + abs(h[i]-h[i-2]))
print(cost[n-1])
# Judge status: Accepted
x = int(input())

num = x // 11

x %= 11
if x == 0:
    print(num * 2)
elif x <= 6:
    print(num * 2 + 1)
else:
    print(num * 2 + 2)
# Judge status: Wrong Answer
a, b, c = input().split(' ')

if c >= a and c <= b:
    print ('Yes')
else:
    print ('No')
# Judge status: Accepted
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.readline
#read = sys.stdin.buffer.read

def main():
    N = int(input())
    A = list(map(int, input().split()))
    base = 0
    for a in A:
        base ^= a
    ans = []
    for i in range(N):
        ans.append(base^A[i])

    print(*ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
a,b=(int(i)for i in input().split())
print("unsafe" if a<=b else "safe")
# Judge status: Accepted
from collections import deque
k = int(input())
lunlun = deque([i for i in range(9, 0, -1)])
for i in range(k):
    x = lunlun.pop()
    if i == k - 1:
        print(x)
    next_lunlun = 10*x + (x % 10)
    if x % 10 != 0:
        lunlun.appendleft(next_lunlun - 1)
    lunlun.appendleft(next_lunlun)
    if x % 10 != 9:
        lunlun.appendleft(next_lunlun + 1)
# Judge status: Wrong Answer
d, n = list(map(int,input().split()))
print((100**d)*n)
# Judge status: Accepted
A=list(map(int,input().split()))
ans=0
for i in A:
    ans+=i
if ans>=22:
    print("bust")
else:
    print("win")
# Judge status: Accepted
n=int(input())
a=int(input())

if n%500<=a:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
q = int(input())
C = Counter(a)
s = sum(a)
for i in range(q):
    b, c = map(int, input().split())
    print(s + (c - b) * C[b])
    s += (c - b) * C[b]
    C[c] += C[b]
# Judge status: Accepted
n = int(input())
s = str(n)

a = 0
for i in range(len(s)):
    a += int(s[i])

b = int(s[0])-1+(len(s)-1)*9

print(max(a, b))
# Judge status: Accepted
import math
print(math.ceil(int(input())/min([int(input()) for _ in range(5)]))+4)
# Judge status: Wrong Answer
N=int(input())
A=sorted(list(map(int, input().split())))
arr=[None]*N
for a in range(N):
  arr[A[a]-1]=a+1
print(arr)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
s = [0] * (N + 1)
for i in range(N):
    s[i + 1] = s[i] + a[i]
ans = float('Inf')
for i in range(1, N):
    #print(ans)
    kouho = abs(s[i] - ((s[-1]) - s[i]))
    if ans > kouho:
        ans = kouho
    #ans = min(ans, kouho)
print(ans)
# Judge status: Wrong Answer
import bisect
N,M,K = map(int, input().split())
A= list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(1,len(A)):
    A[i]+=A[i-1]
for i in range(1,len(B)):
    B[i]+=B[i-1]

honn=bisect.bisect(B,K)
print(honn)
for i in range(len(A)):
    s=K-A[i]
    if s>=0:
        
        a=bisect.bisect(B,s)
        #print(s)
        if i+1+a>honn:
            honn=i+1+a
print(honn)
# Judge status: Wrong Answer
data = input().split()

a = int(data[0])
b = int(data[1])
c = int(data[2])
d = int(data[3])

multi = c * d

count = 0

for i in range(a, b + 1):
  if i % multi != 0:
    count += 1

print(count)
# Judge status: Accepted
S = input()

T = input()

ans = float("inf")
for i in range(len(S) - len(T)+1):
    tmp = 0
    for j in range(len(T)):
        # print(S[i+j], T[j])
        if S[i+j] != T[j]:
            tmp += 1
    ans = min(tmp, ans)
print(ans)
# Judge status: Accepted
N_en = int(input())
A_mai = int(input())

mod = N_en - 500 * (N_en // 500)

if (A_mai >= mod):
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n=int(input())
txy=[list(map(int,input().split())) for _ in range(n)]
txy.insert(0,[0,0,0])
for i in range(n):
  d=abs(txy[i+1][1]-txy[i][1])+abs(txy[i+1][2]-txy[i][2])
  if ((txy[i+1][0]-txy[i][0])-d)<0:
    print("No")
    exit()
  elif d%2==0:
    print("No")
    exit()
print("Yes")
# Judge status: Wrong Answer
import random
D = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for i in range(D)]
 
for i in range(D):
  rand = random.randrange(0, 26)
  print(rand)
# Judge status: Accepted
N = int(input())
a = list(map(int,input().split()))

cnt2 = 0
cnt4 = 0
cntodd = 0
for i in a:
    if i % 4 == 0:
        cnt4 += 1
    elif i % 2 == 0:
        cnt2 += 1
    else:
        cntodd += 1

if cnt2 == 0 and cnt4 + 1 >= cntodd:
    ans = 'Yes'
elif cnt4 >= cntodd:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
# Judge status: Accepted
import sys

def solve():
    a, b = input().split()
    D = [a * int(b), b * int(a)]
    D.sort()
    print(D[0])

    return 0

if __name__ == "__main__":
    solve()
# Judge status: Accepted
INF = float("inf")

n, m, x = map(int, input().split())
c, a = [0] * n, [None] * n
for i in range(n):
    c[i], *a[i] = map(int, input().split())
ans = INF

for bit in range(2 ** n):
    s = [0] * m
    cost = 0
    for i in range(n):
        if bit >> i & 1:
            cost += c[i]
            for j in range(m):    
                s[j] += a[i][j]
    if min(s) >= x:
        ans = min(cost, ans)

print(-1 if ans == INF else ans)
# Judge status: Accepted
x,a,b=map(int,input().split())
if b<=a:
  print("delicious")
elif a<b and b<=a+x:
  print("safe")
else:
  print("dangerous")
# Judge status: Accepted
import math

angle = int(input())
c = 1
x = 0
y = 1

while [round(x,2),round(y,2)] != [0,0]:
  angle_u= 180-angle*c
  y -= math.cos(math.radians(angle_u))
  x -= math.sin(math.radians(angle_u))
  c += 1
else:
  print(c)
# Judge status: Accepted
n = int(input())
c = input()
lists = list(c)
cnt = 0

for i in range(len(lists)):
    if lists[i] == "R":
        cnt += 1
change = 0
for i in range(cnt):
    if lists[i] == "W":
        change += 1
print(change)
# Judge status: Accepted
import math
mod = 10**9+7
N,M = map(int,input().split())
if abs(N-M) > 1:
    print(0)
elif N == M:
    print((math.factorial(N)*math.factorial(M)*2)%mod)
else:
    print((math.factorial(N)*math.factorial(M))%mod)
# Judge status: Accepted
k = int(input())

if k%10 in [2,4,5,7,9]:
    print('hon')

elif k%10 in [0,1,6,8]:
    print('pon')

else:
    print('bon')