Harryxun/stf_run huggingface dataset:
N=int(input())
 
flag=[0]*8
 
a=list(map(int,input().split()))
 
count=0
 
for i in range(N):
 if 1<=a[i]<=399:
  flag[0]=1
 if 400<=a[i]<=799:
  flag[1]=1
 if 800<=a[i]<=1199:
  flag[2]=1
 if 1200<=a[i]<=1599:
  flag[3]=1
 if 1600<=a[i]<1999:
  flag[4]=1
 if 2000<=a[i]<2399:
  flag[5]=1
 if 2400<=a[i]<2799:
  flag[6]=1
 if 2800<=a[i]<3199:
  flag[7]=1
 if 3200<=a[i]:
  count+=1
 
print(min(sum(flag),1),sum(flag)+count)
N=int(input())
 
flag=[0]*8
 
a=list(map(int,input().split()))
 
count=0
 
for i in range(N):
 if 1<=a[i]<=399:
  flag[0]=1
 if 400<=a[i]<=799:
  flag[1]=1
 if 800<=a[i]<=1199:
  flag[2]=1
 if 1200<=a[i]<=1599:
  flag[3]=1
 if 1600<=a[i]<1999:
  flag[4]=1
 if 2000<=a[i]<2399:
  flag[5]=1
 if 2400<=a[i]<2799:
  flag[6]=1
 if 2800<=a[i]<3199:
  flag[7]=1
 if 3200<=a[i]:
  count+=1
 
print(max(sum(flag),1),sum(flag)+count)


### FIXED CODE ###

N=int(input())
 
flag=[0]*8
 
a=list(map(int,input().split()))
 
count=0
 
for i in range(N):
 if 1<=a[i]<=399:
  flag[0]=1
 if 400<=a[i]<=799:
  flag[1]=1
 if 800<=a[i]<=1199:
  flag[2]=1
 if 1200<=a[i]<=1599:
  flag[3]=1
 if 1600<=a[i]<=1999:
  flag[4]=1
 if 2000<=a[i]<=2399:
  flag[5]=1
 if 2400<=a[i]<=2799:
  flag[6]=1
 if 2800<=a[i]<=3199:
  flag[7]=1
 if 3200<=a[i]:
  count+=1
 
print(max(1,sum(flag)),sum(flag)+count)
#入力
day = input()


if day == "MON":
  answer = 6
  
if day == "TUE":
  answer = 5
if day == "WEN":
  answer = 4
if day == "TUR":
  answer = 3
if day == "FRY":
  answer = 2
if day == "SAT":
  answer = 1
if day == "SUN":
  answer = 7

print(answer)


### FIXED CODE ###

#入力
day = input()


if day == "MON":
  answer = 6
  
if day == "TUE":
  answer = 5
if day == "WED":
  answer = 4
if day == "THU":
  answer = 3
if day == "FRI":
  answer = 2
if day == "SAT":
  answer = 1
if day == "SUN":
  answer = 7

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

if n+1 < 2*m:
    print(0)
else:
    a = [int(input()) for _ in range(m)]

    pre2 = 0
    pre1 = 0
    cur = 1
    a_id = 0

    for i in range(n):
        pre2 = pre1
        pre1 = cur 
        cur = pre1 + pre2
        if i+1 == a[a_id]:
            a_id += 1 if a_id < m-1 else 0
            cur = 0
        if cur == 0 and pre1 == 0:
            break
    print(cur%1000000007)

### FIXED CODE ###

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

if n+1 < 2*m:
    print(0)
else:
    a = [int(input()) for _ in range(m)]

    pre2 = 0
    pre1 = 0
    cur = 1
    a_id = 0

    for i in range(n):
        pre2 = pre1
        pre1 = cur 
        cur = pre1 + pre2
        if a_id < m:
            if i+1 == a[a_id]:
                a_id += 1 if a_id < m-1 else 0
                cur = 0
        if cur == 0 and pre1 == 0:
            break
    print(cur%1000000007)
n, x, y = input().split()
n, x, y = int(n), int(x)-1, int(y)-1
d = [[abs(i-j) for i in range(n)] for j in range(n)]
for i in range(x+1):
    for j in range(y, n):
        d[i][j] -= y-x-1
    for j in range(y-1, x+(y-x)//2, -1):
        d[i][j] = d[i][j+1]+1
for i in range(x+1, x+(y-x)//2):
    for j in range(y, n):
        d[i][j] -= i-x
    for j in range(y-1, x+3*(y-x)//4, -1):
        d[i][j] = d[i][j+1]+1
apar = [0 for i in range(n)]
for i in range(n-1):
    for j in range(i+1, n):
        apar[d[i][j]] += 1
for i in range(1, n):
    print(apar[i])


### FIXED CODE ###

n, x, y = input().split()
n, x, y = int(n), int(x)-1, int(y)-1
d = [[abs(i-j) for i in range(n)] for j in range(n)]
for i in range(x+1):
    for j in range(y, n):
        d[i][j] -= y-x-1
    for j in range(y-1, x+(y-x)//2, -1):
        d[i][j] = d[i][j+1]+1
for i in range(x+1, x+(y-x)//2):
    d[i][y] = d[i][x] + 1
    for j in range(y+1, n):
        d[i][j] = d[i][j-1]+1
    for j in range(y-1, x+(y-x)//2+(i-x), -1):
        d[i][j] = d[i][j+1]+1
apar = [0 for i in range(n)]
for i in range(n-1):
    for j in range(i+1, n):
        apar[d[i][j]] += 1
for i in range(1, n):
    print(apar[i])
N = int(raw_input())
a = raw_input()
aa = a.split(" ")
aaa = []
# for i in range(len(aa)):
# 	aaa.append((i+1,int(aa[i])))

ctr = 0

# for (a,b) in aaa:
# 	if (b,a) in aaa:
# 		aaa.remove((a,b))
# 		aaa.remove((b,a))
# 		ctr = ctr + 1

print(str(ctr))

### FIXED CODE ###

s = raw_input()
s2 = s[:4] + " " + s[4:]
print(s2)
a, b, k = map(int, raw_input().split())
for x in range(a,b):
  if x < a + k  or x > b - k:
    print(x)
  else:
    continue

### FIXED CODE ###

a, b, k= map(int, input().split())
for x in range(a,min(a+k,b+1)):
    print(x)
for x in range(b-k+1,b+1):
    if x < a+k:
        continue
    else:
        print(x)
n = int(input())
Mnum = 0
Anum = 0
Rnum = 0
Cnum = 0
Hnum = 0
for i in range(n):
  a = input()
  if a[0] == "M":Mnum+=1
  elif a[0] == "A":Anum+=1
  elif a[0] == "R":Rnum+=1
  elif a[0] == "C":Cnum+=1
  elif a[0] == "H":Hnum+=1
alist = []
alist.append(Mnum)
alist.append(Anum)
alist.append(Rnum)
alist.append(Cnum)
alist.append(Hnum)
from itertools import combinations
blist =list(combinations(alist,3))
from functools import reduce
sum = 0
for i in range(len(blist)):
  sum+=reduce(mul,blist)
print(sum)

### FIXED CODE ###

n = int(input())
Mnum = 0
Anum = 0
Rnum = 0
Cnum = 0
Hnum = 0
for i in range(n):
  a = input()
  if a[0] == "M":
    Mnum+=1
  elif a[0] == "A":
    Anum+=1
  elif a[0] == "R":
    Rnum+=1
  elif a[0] == "C":
    Cnum+=1
  elif a[0] == "H":
    Hnum+=1
alist = []
alist.append(Mnum)
alist.append(Anum)
alist.append(Rnum)
alist.append(Cnum)
alist.append(Hnum)
from itertools import combinations
print(sum([a*b*c for a,b,c in combinations(alist,3)]))
import re
S=list(input())

if S[0]!='A':
    print('WA')
    exit()

if S[2:len(S)-1].count('C')!=1:
    print('WA')
    exit()

S.remove('C')
S.remove('A')

for i in S:
    if i not in 'abcdefghizklmnopqrstuvwxyz':
        exit('WA')


print('AC')


### FIXED CODE ###

S=list(input())

if S[0]!='A':
    print('WA')
    exit()

if S[2:len(S)-1].count('C')!=1:
    print('WA')
    exit()

S.remove('C')
S.remove('A')

for i in S:
    if i not in 'abcdefghizklmnopqrstuvwxyz':
        print('WA')
        exit()


print('AC')
import sys
import math
import itertools
import random
n=int(input())
lis=[0]*(10**5)
for a in range(1,int((math.sqrt(n)/2)+100)):
    for b in range(1,int((math.sqrt(n)/2)+100)):
        for c in range(1,int((math.sqrt(n)/2)+100)):
            lis[int(a**2+b**2+c**2+a*b+b*c+c*a)]+=1
for i in range(1,n+1):
    print(lis[i])

### FIXED CODE ###

import sys
import math
import itertools
import random
n=int(input())
lis=[0]*(10**8)
for a in range(1,int((math.sqrt(n)/2)+100)):
    for b in range(1,int((math.sqrt(n)/2)+100)):
        for c in range(1,int((math.sqrt(n)/2)+100)):
            lis[int(a**2+b**2+c**2+a*b+b*c+c*a)]+=1
for i in range(1,n+1):
    print(lis[i])
def is_even():
  a, b = map(int, input().split())
    if (a*b)% 2 == 0:
        print("Even")
    else:
        print("Odd")

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b)% 2 == 0:
   print('Even')
else:
   print('Odd')
N, M, C = list(map(int, input().split()))
B = list(map(int, input().split())
A = []

for i in range(N):
	A.append(list(map(int, input().split())
	
def main():
	cnt = 0
	for i in range(N):
		val = C
		for j in range(M):
			val += A[i][j] * B[j]
		if val > 0:
			cnt += 1
	return cnt
print(main)


### FIXED CODE ###

N, M, C = list(map(int, input().split()))
B = list(map(int, input().split()))
A = []
for i in range(N):
    A.append(list(map(int, input().split())))

def main():
    cnt = 0
    for i in range(N):
        val = C
        for j in range(M):
            val += A[i][j] * B[j]
        if val > 0:
            cnt += 1
    return cnt

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

ps = [-1] * n
ps[0] = 0
tmps = {}
for _ in range(m):
    a,b=map(int,input().split())
    ai,bi=a-1,b-1
    if ai not in tmps:
        tmps[ai] = []
    tmps[ai].append(bi)
    if bi not in tmps:
        tmps[bi] = []
    tmps[bi].append(ai)

# print(tmps)

if 0 not in tmps:
    print("No")
    exit()


def puts(ks):
    nks = []
    for k in ks:
        _nks = tmps[k]
        for nk in _nks:
            if ps[nk] == -1:
                ps[nk] = k
                nks.append(nk)
        # print(k, ps)
    if nks == []:
        return
    # print(ks, ps)
    puts(nks)  
ks = [0]
puts(ks)

# print(ps)

if -1 in ps:
    print("No")
    exit()

print("Yes")
for p in ps[1:]:
    print(p+1)

### FIXED CODE ###

import sys
sys.setrecursionlimit(9999)

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

ps = [-1] * n
ps[0] = 0
tmps = {}
for _ in range(m):
    a,b=map(int,input().split())
    ai,bi=a-1,b-1
    if ai not in tmps:
        tmps[ai] = []
    tmps[ai].append(bi)
    if bi not in tmps:
        tmps[bi] = []
    tmps[bi].append(ai)

# print(tmps)

if 0 not in tmps:
    print("No")
    exit()


def puts(ks):
    nks = []
    for k in ks:
        _nks = tmps[k]
        for nk in _nks:
            if ps[nk] == -1:
                ps[nk] = k
                nks.append(nk)
    if nks == []:
        return None
    # puts(nks)
    return nks

ks = [0]
while True:
    nks = puts(ks)
    if nks is None:
        break
    else:
        ks = nks

#print(ps)

if -1 in ps:
    print("No")
    exit()

print("Yes")
for p in ps[1:]:
    print(p+1)
a,b=[int(x) for x in input().split()]

if a<b:
print('a<b')

elif a>b:
print('a>b')

else:
print('a==b')


### FIXED CODE ###

a,b=[int(x) for x in input().split()]
op = '>' if a>b else '<' if a<b else '=='
print('a',op,'b')
from operator import itemgetter
def main():
    N,M = map(int,input().split())
    sc = [list(map(int,input().split())) for _ in range(M)]
    s = [sc[i][0] for i in range(M)]
    c = [sc[i][1] for i in range(M)]
    ans = [0]*max(s)
    ans[0] = 1
    for i in range(M):
        if s[i]-1 == 0:
            if ans[0] == 1 or ans[0] == c[i]:
                ans[0] = c[i]
            else:
                ans = "-1"
                break
        if ans[s[i]-1] == 0 or ans[s[i]-1] == c[i]:
            ans[s[i]-1] = c[i]
        else:
            ans = "-1"
            break
    if ans == "-1":
        print("-1")
    else:
        ans = list(map(str,ans))
        if ans == ["0"]:
            print("-1")
        else:
            print(*ans,sep="")

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    N,M = map(int,input().split())
    sc = [list(map(int,input().split())) for _ in range(M)]
    if M == 0:
        if N != 1:
            print(10**(N-1))
        else:
            print(0)
    else:
        ans = "-1"
        flag = False
        for i in range(10**N):
            if flag:
                break
            tmp = str(i)
            if len(tmp) < N:
                continue
            for j in range(M):
                if tmp[sc[j][0]-1] != str(sc[j][1]):
                    break
                if j == M-1:
                    ans = i
                    flag = True
        print(ans)

if __name__ == '__main__':
    main()
print(int(input()**2))

### FIXED CODE ###

print(int(input())**2)
n,m=map(int,input().splt())
ans=((n*(n-1))/2)+(m*(m-1))/2
print(int(ans))

### FIXED CODE ###

n,m=map(int,input().split())
ans=((n*(n-1))/2)+(m*(m-1))/2
print(int(ans))
#!/usr/bin/env python3
import sys
from collections import deque

def solve(N: int, Q: int, a: "List[int]", b: "List[int]", p: "List[int]", x: "List[int]"):

    answer = [0]*N
    linked_list = [[] for _ in range(N)]
    for i in range(N-1):
        linked_list[a[i]-1].append(b[i]-1)
        linked_list[b[i]-1].append(a[i]-1)
    
    c = [0]*N
    is_Visited = [False]*N

    for j in range(Q):
        c[p[j]-1] += x[j]
    answer[0] = c[0]
    
    def dfs(node,counter):
        counter += c[node]
        is_Visited[node] = True
        for n in linked_list[node]:
            if is_Visited[n] == False:
                answer[n] = dfs(n,counter)
        
        return counter
        
    dfs(0,0)
    print(*answer)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    Q = int(next(tokens))  # type: int
    a = [int()] * (N - 1)  # type: "List[int]"
    b = [int()] * (N - 1)  # type: "List[int]"
    for i in range(N - 1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    p = [int()] * (Q)  # type: "List[int]"
    x = [int()] * (Q)  # type: "List[int]"
    for i in range(Q):
        p[i] = int(next(tokens))
        x[i] = int(next(tokens))
    solve(N, Q, a, b, p, x)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
from collections import deque

def solve(N: int, Q: int, a: "List[int]", b: "List[int]", p: "List[int]", x: "List[int]"):
    matrix = [[] for _ in range(N+1)]
    counter = [0]*(N+1)
    for i in range(N-1):
        matrix[a[i]].append(b[i])
        matrix[b[i]].append(a[i])

    for q in range(Q):
        counter[p[q]]+=x[q]

    queue = deque()
    queue.append(1)

    checkflag = [False]*(N+1)
    while queue:
        root = queue.pop()
        checkflag[root]=True
        for node in matrix[root]:
            if checkflag[node] == False:
                queue.append(node)
                counter[node]+=counter[root]

    print(*counter[1:])




        
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    Q = int(next(tokens))  # type: int
    a = [int()] * (N - 1)  # type: "List[int]"
    b = [int()] * (N - 1)  # type: "List[int]"
    for i in range(N - 1):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
    p = [int()] * (Q)  # type: "List[int]"
    x = [int()] * (Q)  # type: "List[int]"
    for i in range(Q):
        p[i] = int(next(tokens))
        x[i] = int(next(tokens))
    solve(N, Q, a, b, p, x)

if __name__ == '__main__':
    main()
a = range(1, 8 + 1)
    b = range(1, 8 + 1)
    c = range(1, 8 + 1)
    d = range(1, 8 + 1)

    if a == b or b == c or c == d:
        return ('Bad')
    else:
        return ('Good')

### FIXED CODE ###

s = list(input())

if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')
# coding: utf-8


def main():
    
    takahashi_cookie, aoki_cookie, action_count = map(int, input().split(' '))

    if action_count < takahashi_cookie:
        takahashi_result = takahashi_cookie - action_count
        aoki_result = aoki_result
        
    elif action_count <= (takahashi_cookie + aoki_cookie):
        takahashi_result = 0
        aoki_result = aoki_cookie - (action_count - takahashi_cookie)
        
    else:
        takahashi_result = 0
        aoki_result = 0
        
    print(takahashi_result, aoki_result)

    return 0
    

if __name__ == '__main__':
    main()


### FIXED CODE ###

#coding:utf-8
 
 
def main():
    list1  = list(map(int, input().split(' '))) 
    a, b, k = list1
  
    if a > k:
        a = a - k
      
    elif a + b >= k:
        b = b - (k - a)
        a = 0
        
    else:
        a = 0
        b = 0
        
    print(a, b)
  
    return 0
 
 
if __name__ == '__main__':
    main()
import itertools
N = int(input())
A = list(map(int, input().split()))
ans = 0

for v in itertools.combinations(A, 2):
    ans += v[0] ^ v[1]
    
print(ans % (10**9 + 7))

### FIXED CODE ###

A1, A2, A3 = map(int, input().split())

if A1 + A2 + A3 > 21:
  print('bust')
else:
  print('win')
l = input().split()
if l[0]*l[1]%2 ==0:
    print(Even)
    else:
    print(Odd)

### FIXED CODE ###

l= list(map(int, input().split()))
if l[0]*l[1]%2 ==0:
    print("Even")
else:
    print("Odd")
import sys
def codefestival(s):
    return s[4:] + ' ' + s[4:]
codefestival(sys.argv[1])

### FIXED CODE ###

# -*- coding: utf-8 -*-
s = raw_input()
print s[:4] + ' ' + s[4:]
from math import gcd
A,B,C,D,E,F = (int(T) for T in input().split())
SugerMax = 0
for TC in range(0,D//gcd(C,D)):
    RestC = F-C*TC
    for TD in range(0,(RestC//D)+1):
        RestD = RestC-D*TD
        Suger = C*TC+D*TD
        if RestD>=0:
            NeedMin = (100*Suger)/E
            for TA in range(0,B//gcd(A,B)):
                for TB in range(0,(F//100)+1):
                    Water = A*TA*100+B*TB*100
                    if Water<=RestD:
                        if NeedMin<=Water and SugerMax<Suger:
                            SugerMax = Suger
                            WaterMax = Water
                    else:
                        break
        else:
            break
print('{} {}'.format(WaterMax+SugerMax,SugerMax))

### FIXED CODE ###

A,B,C,D,E,F = (int(T) for T in input().split())
SugM = 0
WatM = 100*A
for TA in range(0,(F//100)+1):
    for TB in range(0,(F//100)+1):
        if TA==TB==0:
            continue
        else:
            Water = TA*100*A+TB*100*B
            RestW = F-Water
            if RestW>=0:
                for TC in range(0,RestW+1):
                    for TD in range(0,RestW+1):
                        Suger = TC*C+TD*D
                        RestS = RestW-Suger
                        if RestS>=0 and Water>=(100*Suger)/E:
                            if Suger/(Suger+Water)>SugM/(SugM+WatM):
                                SugM = Suger
                                WatM = Water
                        else:
                            break
            else:
                break
print('{} {}'.format(WatM+SugM,SugM))
h,w = map(int,input().split())
maps = []

for i in range(h):
    maps.append(list(map(str,input().split())))
for i in range(h):
    for j in range(w):
        if maps[i][j] == "snuke":
            print('{}{}'.format(chr(row.index('snuke')+65),i+1))
            exit()

### FIXED CODE ###

h,w = map(int,input().split())
maps = []
alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
for i in range(h):
    maps.append(list(map(str,input().split())))
for i in range(h):
    for j in range(w):
        if maps[i][j] == "snuke":
            print(alphabet[j]+str(i+1))
            exit()
dens = 0
ans_water = 0
ans_sugar = 0
for i in range(31):
    for j in range(31):
        for k in range(101):
            for l in range(101):
                water = 100*A*i+100*B*j
                sugar = C*k+D*l
                if i==j==0:
                    break
                if water+sugar <= F and sugar <= E*(A*i+B*j):
                    if dens<sugar/(sugar+water):
                        dens = sugar/(sugar+water)
                        ans_water = water
                        ans_sugar = sugar
print(ans_water+ans_sugar, ans_sugar)

### FIXED CODE ###

A, B, C, D, E, F = map(int, input().split())
dens = 0
ans_water = 100*min(A, B)
ans_sugar = 0
for i in range(31):
    for j in range((F-(100*A*i))//(100*B)+1):
        for k in range((F-(100*A*i)-(100*B*j))//C+1):
            for l in range((F-(100*A*i)-(100*B*j)-(C*k))//D+1):
                water = 100*A*i+100*B*j
                sugar = C*k+D*l
                if water == 0:
                    break
                if sugar <= E*(A*i+B*j):
                    if dens<sugar/(sugar+water):
                        dens = sugar/(sugar+water)
                        ans_water = water
                        ans_sugar = sugar
print(ans_water+ans_sugar, ans_sugar)
A,B = map(int,input().split())
a = format(A-1,'b')
b = format(B,'b')
le = len(b)
part = []
whole = []
for i in range(1,le+1):
  whole += [int(b[i-1])]
  df = le - len(a)
  if i <= df:
    part += [0]
  else:
    part += [int(a[i-1-df])]
p = 0
for i in range(le):
  p *= 10
  if i == le-1:
    if int(a)%4 == 1 or int(a)%4 == 2:
      p += 1
  elif part[i] == 0:
    pass
  else:
    p += 1- int(a)%2
w = 0
for i in range(le):
  w *= 10
  if i == le-1:
    if int(b)%4 == 1 or int(b)%4 == 2:
      w += 1
  elif whole[i] == 0:
    pass
  else:
    w += 1- int(b)%2
print(int(str(w),2)^int(str(p),2))

### FIXED CODE ###

a,b = map(lambda x:
          int(format(int(x),'b')),input().split())
a -= 1
A = str(a)
la = len(A)
ga = [0]*la
if a%4 == 1 or a%4 == 2:
  ga[-1] = 1
for ai in range(0,la-1):
  if A[ai] == '1' and A[-1] == '0':
    ga[ai] = 1
aa = 0
for ai in range(la):
  aa *= 2
  aa += ga[ai]
B = str(b)
lb = len(B)
gb = [0]*lb
if b%4 == 1 or b%4 == 2:
  gb[-1] = 1
for bi in range(0,lb-1):
  if B[bi] == '1' and B[-1] == '0':
    gb[bi] = 1
bb = 0
for bi in range(lb):
  bb *= 2
  bb += gb[bi]
if a < 0:
  print(bb)
else:
  print(aa^bb)
n, m, k = map(int, input().split())
arA = list(map(int, input().split()))
arB = list(map(int, input().split()))

idxA = idxB = 0
readTime :int = 0
readBooks :int = 0
while readTime < k:
    if arA[idxA] <= arA[idxB] and idxA < n:
        if k < readTime + arA[idxA]:
            break
        readTime += arA[idxA]
        idxA += 1
    else:
        if k < readTime + arB[idxB]:
            break
        readTime += arB[idxB]
        idxB += 1
    readBooks += 1
    if idxA >= n and idxB >= m:
        break

print(readBooks)


### FIXED CODE ###

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

a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for i in range(M):
    b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
    if a[i] > K:
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans, i + j)
print(ans)
A = int(input())
c = 0
for i in range(1,10):
  if (A % i == 0 and A // i < 10):
    c += 1
if c > 0:
  print("Yes")
else:
  print("No"

### FIXED CODE ###

A = int(input())
c = 0
for i in range(1,10):
  if (A % i == 0 and A // i < 10):
    c += 1
if c > 0:
  print("Yes")
else:
  print("No")
import numpy as np
n = int(input())
cnt = [0 for i in range(10**6)]

for i in range(n):
  cnt[int(input())-1] += 1
  
print( (np.array(cnt) % 2).sum())

### FIXED CODE ###

from collections import Counter
n = int(input())
a = Counter([int(input()) for i in range(n)])

cnt = 0
for k, v in a.items():
  if v % 2 == 1:
    cnt += 1
print(cnt)
def solve(n, a_list):
    numbers_map = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
    usable_map = {}
    for a in a_list:
        usable_map[a] = numbers_map[a]

    # 1-origin 桁数を保存 -infで初期化
    inf = 1000
    dp = [0] + [-inf for _ in range(n)]
    for value in usable_map.values():
        dp[value] = 1

    # time O(NM)
    for cost in range(1, n + 1):
        for value in usable_map.values():
            if cost - value < 0 or dp[cost - value] == 0:
                continue
            dp[cost] = max(
                dp[cost],
                dp[cost - value] + 1
            )

    buff = []
    digit = n
    reverse_usable_list = sorted(usable_map.items(), reverse=True)
    while True:
        for num, value in reverse_usable_list:
            if digit - value < 0 or dp[digit] - 1 != dp[digit - value]:
                continue
            buff.append(str(num))
            digit -= value
            break
        if digit <= 0:
            break

    return "".join(buff)


def main():
    n, m = map(int, input().split())
    a_list = list(map(int, input().split()))

    ans = solve(n, a_list)
    print(ans)


main()


### FIXED CODE ###

def solve(n, a_list):
    numbers_map = {1: 2, 2: 5, 3: 5, 4: 4, 5: 5, 6: 6, 7: 3, 8: 7, 9: 6}
    usable_map = {}
    for a in a_list:
        usable_map[a] = numbers_map[a]

    # 1-origin 桁数を保存 -infで初期化
    inf = 1000
    dp = [0] + [-inf for _ in range(n)]
    for value in usable_map.values():
        if value <= n:
            dp[value] = 1

    # time O(NM)
    for cost in range(1, n + 1):
        for value in usable_map.values():
            if cost - value < 0 or dp[cost - value] == 0:
                continue
            dp[cost] = max(
                dp[cost],
                dp[cost - value] + 1
            )

    # time O(M log(M))
    buff = []
    digit = n
    reverse_usable_list = sorted(usable_map.items(), reverse=True)
    while True:
        for num, value in reverse_usable_list:
            if digit - value < 0 or dp[digit] - 1 != dp[digit - value]:
                continue
            buff.append(str(num))
            digit -= value
            break
        if digit <= 0:
            break

    return "".join(buff)


def main():
    n, m = map(int, input().split())
    a_list = list(map(int, input().split()))

    ans = solve(n, a_list)
    print(ans)


main()