Harryxun/stf_run huggingface dataset:
import math
N, M = map(int, input().split())
sqrt = int(math.sqrt(M)) + 1
ans = 0
for i in range(1, sqrt):
    if M % i == 0:
        if ans < i <= M//N:
            ans = i
        if ans < M//i <= M//N:
            ans = M//i
print(ans)


### FIXED CODE ###

N = int(input())
lst = [list(map(int, input().split())) for _ in range(N)]

for cx in range(101):
    for cy in range(101):
        for l in lst:
            if l[2] != 0:
                H = abs(cx-l[0]) + abs(cy-l[1]) + l[2]
        for l in lst:
            if l[2] != max(0, H - abs(cx-l[0]) - abs(cy-l[1])):
                break
        else:
            print(cx, cy, H)
            exit(0)
s = input()
k = int(input())

if len(s) == 1:
  print(k // 2)
else:
  cnt = 0
  p = 1
  s = s*k
  while p < len(s):
    if s[p-1] == s[p]:
      cnt += 1
      p += 1
    p += 1
      
  print(cnt)

### FIXED CODE ###

s = input()
k = int(input())

if len(s) == 1:
  print(k // 2)
else:
  cnt = 0
  p = 1
  while p < len(s):
    if s[p-1] == s[p]:
      cnt += 1
      p += 1
    p += 1
      
  cnt2 = 0
  p2 = 1
  s2 = s + s
  while p2 < len(s2):
    if s2[p2-1] == s2[p2]:
      cnt2 += 1
      p2 += 1
    p2 += 1

  flg = 1
  for i in range(len(s)-1):
    if s[i] != s[i+1]:
      flg = 0
  
  if 2*cnt < cnt2:
    if flg == 1:
      print(k*cnt + (k//2))
    else:
      print(k*cnt + (k - 1))
  else:
    print(k*cnt)
s=input()
print(s.count('+')-s.count.('-'))

### FIXED CODE ###

s=input()
print(s.count('+')-s.count('-'))
from collections import Counter
N = int(input())
D = list(map(int,input().split()))
M = int(input())
T = list(map(int,input().split()))
Tcount = Counter(T)
flag = 'YES'
Dcount = Counter(D)
for n,c in Tcount.items():
    if c > D[n]:
        flag = 'NO'
        break
print(flag)


### FIXED CODE ###

from collections import Counter
N = int(input())
D = list(map(int,input().split()))
M = int(input())
T = list(map(int,input().split()))
Tcount = Counter(T)
flag = 'YES'
Dcount = Counter(D)
for n,c in Tcount.items():
    if n not in Dcount:
        flag = 'NO'
        break
    if c > Dcount[n]:
        flag = 'NO'
        break
print(flag)
N,A,B = map(int, [input() for i in range(3)])

def sum(n):
    str_n = str(n)
    ans = 0
    for i in range(len(str_n)):
        ans += int(str_n[i])
    return ans
    
ans1 = 0
for i in range(N+1):
    if A <= sum(i) <= B:
        ans1 += i
print(ans1)


### FIXED CODE ###

def sum(n):
    str_n = str(n)
    ans = 0
    for i in range(len(str_n)):
        ans += int(str_n[i])
    return ans

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

ans1 = 0
for i in range(N+1):
    if A <= sum(i) <= B:
        ans1 += i
    else:
        continue
print(ans1)
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


import time, random
start = time.time()

D = int(input())
c = list(map(int, input().split()))
s = [None]*D
for i in range(D):
    s[i] = list(map(int, input().split()))
    
current = [0]*26
ans = [None]*D
def greedy():
    ans = [None]*D
    for i,ss in enumerate(s):
        vs = [None]*26
        for j in range(26):
            vs[j] = (ss[j] + current[j], j)
            current[j] += c[j]
        vs.sort()
        v = vs[-1][1]
        ans[i] = v+1
        current[v] = 0
    return ans
def val(ans):
    current = [0]*26
    val = 0
    for i,(ss, v) in enumerate(zip(s, ans)):
        for j in range(26):
            current[j] += c[j]
        current[v-1] = 0
        val += ss[i] - sum(current)
    return val
ans = greedy()
num = 2
ren = 0
while (time.time()-start)<=1.90:
    v = val(ans)
#     print(v)
    index = random.sample(range(D),num)
    prev = index[0]
    tmp = ans[prev]
    tmpans = ans[:]
    for ind in index[1:]:
        ans[prev] = ans[ind]
        prev = ind
    ans[index[-1]] = tmp
    if v<val(ans):
        pass
    else:
        ren += 1
        if ren>=100:
            num = min(num+1, D)
            res = 0
        ans = tmpans
# print(v)
write("\n".join(map(str, ans)))

### FIXED CODE ###

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


D = int(input())
c = list(map(int, input().split()))
s = [None]*D
for i in range(D):
    s[i] = list(map(int, input().split()))
    
current = [0]*26
ans = [None]*D
def greedy():
    ans = [None]*D
    for i,ss in enumerate(s):
        vs = [None]*26
        for j in range(26):
            vs[j] = (ss[j] + current[j], j)
            current[j] += c[j]
        vs.sort()
        v = vs[-1][1]
        ans[i] = v+1
        current[v] = 0
    return ans
ans = greedy()
write("\n".join(map(str, ans)))
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if sum(a)+sum(b)<k:
    ans=m+n
else:
    numa=[0]
    numb=[0]
    for i in range(n):
        if numa[-1]+a[i]>k:
            break
        numa.append(numa[-1]+a[i])
    for j in range(m):
        if numb[-1]+b[i]>k:
            break
        numb.append(numb[-1]+b[i])
    n=len(numa)
    m=len(numb)-1
    ans=0
    for i in range(n):
        num1=k-numa[i]
        for j in range(m):
            if numb[m]<=num1:
                break
            m-=1
        ans=max(ans,i+m)
print(ans)


### FIXED CODE ###

n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
if sum(a)+sum(b)<k:
    ans=m+n
else:
    numa=[0]
    numb=[0]
    for i in range(n):
        numa.append(numa[-1]+a[i])
    for j in range(m):
        numb.append(numb[-1]+b[j])
    ans=0
    for i in range(n+1):
        if numa[i]>k:
            break
        while numb[m]>k-numa[i]:
            m-=1
        ans=max(ans,i+m)
print(ans)
n = input()

print(n ** 3)

### FIXED CODE ###

n = int(input())

print(n ** 3)
n = int(input())
a = [int(x) for x in input().split()]
q = int(input())
for i in range(q):
  a.sort()
  su = 0
  b,c = map(int,input().split())
  for j in range(n):
    if(a[j] > b ):
      break
    if(a[j] == b):
      a[j] = c
    su += a[j]
  print(su)

### FIXED CODE ###

str = input()
if(str.islower()):
  print('a')
else:
  print('A')
n = int(input())
print(sum(i for i in range(i, n + 1) if i % 3 and i % 5))

### FIXED CODE ###

n = int(input())
sum = 0
for i in range(1, n + 1):
    if i % 3 != 0 and i % 5 != 0:
        sum += i
print(sum)
sent=""
while True:
    ex=input().lower()
    sent+=ex
    if ex.find('.')==1:
        break
for i in range(ord("a"),ord("z")+1):
    x=sent.count(chr(i))
    print(chr(i),":",x)

### FIXED CODE ###

sent=""
while True:
    try:
        ex=input().lower()
        sent+=ex
    except:
        break
for i in range(ord("a"),ord("z")+1):
    x=sent.count(chr(i))
    print(chr(i),":",x)
s=map(int,raw_input().split())
sa=0
sb=0
sc=0
for i in range(len(s)):
  if s[i]=="a":
    sa+=1
  if s[i]=="b":
    sb+=1
  if s[i]=="c":
    sc+=1
if sa==1 and sb==1 and sc==1:
    print "Yes"
else: 
    print "No"

### FIXED CODE ###

s=raw_input()
sa=0
sb=0
sc=0
for i in range(len(s)):
  if s[i]=="a":
    sa+=1
  if s[i]=="b":
    sb+=1
  if s[i]=="c":
    sc+=1
if sa==1 and sb==1 and sc==1:
    print "Yes"
else: 
    print "No"
N,X= [int(s) for s in input().split()]
lst = [int(s) for s in input().split()]
dist=0
count=0
while(1):
  dist=dist+lst[count]
  if(dist>X or count==N):
    break
  count=count+1
print(count+1)
  


### FIXED CODE ###

N,X= [int(s) for s in input().split()]
lst = [int(s) for s in input().split()]
dist=0
count=0
while(count<N):
  dist=dist+lst[count]
  if(dist>X):
    break
  count=count+1
print(count+1)
X,Y = map(int,input().split())
S = [X,Y]
map(hex,S)
P = S[0]
Q = S[1]
if P>Q:
  print(">")
elif P==Q:
  print("=")
else:
  print("<")

### FIXED CODE ###

X,Y = map(str,input().split())
S = [X,Y]
map(hex,S)
P = S[0]
Q = S[1]
if P>Q:
  print(">")
elif P==Q:
  print("=")
else:
  print("<")
# -*- coding: utf-8 -*-
"""
Created on Wed May  2 21:28:06 2018
ALDS1_5a
@author: maezawa
"""
import itertools as itr

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

sum_array = []
for r in range(1,n+1):
    for comb in itr.combinations(a, r):
        aum_array.append[sum(comb)]

for i in m:
    yesorno = 'no'
    for j in sum_array:
        if i == j:
            yesorno == 'yes'
            break
    print('yes')



### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Wed May  2 21:28:06 2018
ALDS1_5a_r1  
@author: maezawa
"""
import itertools as itr

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

sum_array = []
for r in range(1,n+1):
    for comb in itr.combinations(a, r):
        sum_array.append(sum(comb))
sum_array.sort()

for i in m:
    left = 0
    right = len(sum_array)
    yesorno = 'no'
    while(left < right):
        #print(left, right)
        mid = (left+right)//2
        if sum_array[mid] == i:
            yesorno = 'yes'
            break
        elif sum_array[mid] > i:
            right = mid
        else:
            left = mid+1
            
    print(yesorno)
H,A = map(int,input().split())
a = H // A
if  H % ! != 0:
	print(a+1)
else:
  print(a)

### FIXED CODE ###

H,A = map(int,input().split())
a = H // A
if  H % A != 0:
	print(a+1)
else:
  print(a)
N = input()
cur = 0
for x, y in zip(N, N[1:]):
    if x == y:
        ans += 1
if cur >= 2:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = input().strip()
if N[0] == N[1] == N[2] or N[1] == N[2] == N[3]:
    print('Yes')
else:
    print('No')
from sys import argv

# Function for calc
def match(n, a, b):
    if (b - a)% 2 == 0:
        print((b-a)/2)
    else:
        if (n - b) > a:
            print((a)+((b-(a+1))/2))
        else:
            x=(n-b+1)
            print(x+((n-(a+x))/2))
# Run match
match(int(argv[1]), int(argv[2]), int(argv[3]))

### FIXED CODE ###

# Function for calc
def match(n, a, b):
    if (b - a)% 2 == 0:
        print((b-a)/2)
    else:
        if (n - b) >= a:
            print((a)+((b-(a+1))/2))
        else:
            x=(n-b+1)
            print(x+((n-(a+x))/2))
# Run match
in_string = raw_input()
[N, A, B] = [int(v) for v in in_string.split()]
match(N, A, B)
n = int(input())
s = input()
k = int(input())
result = []

for x in s:
    if x != s[k]:
        result.append("*")
    else:
        result.append(x)

print("".join(result))


### FIXED CODE ###

n = int(input())
s = input()
k = int(input())
result = []

for x in s:
    if x != s[k-1]:
        result.append("*")
    else:
        result.append(x)

print("".join(result))
N= int(input())
s = []

for _ in range(N):
    s.append(input())

for i in range(N):
    s[i] = [*s[i]]
    s[i] = sorted(s[i])

counter = 0
for i in range(N):
    for j in range((i+1), N):
        if s[i] == s[j]:
            counter += 1

print(counter)   

### FIXED CODE ###

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

jobs = {}
for _ in range(N):
    A, B = map(int, input().split())
    if A > M :
        continue
    if A in jobs:
        jobs[A].append(B)
    else:
        jobs[A] = [B]

#output
import heapq

#点数配列の用意
point = 0
hq = []
#M-i日目(1 <= i <= M)に働ける仕事の中で、Bが最大のものを選ぶ
for A in range(1, M+1):
    if A in jobs:
        for B in jobs[A]:
            heapq.heappush(hq, -B)
    else:
        if len(hq) == 0:
            continue
    point += -heapq.heappop(hq)

print(point)
S = str(input())

def del_cube(s, i):
    s = s[:i] + s[i+2:]
    return s

def dfs(s):
    ans_list = []
    flag = True
    for i in range(len(s) - 1):
        if s[i] == '0' and s[i+1] == '1' or s[i] == '1' and s[i+1] == '0':
            flag = False
            del_s = del_cube(s, i)
            ans_list.append(dfs(del_s))
            
    if flag == True:
        return(len(s))
    else:
        return(min(ans_list))
    
print(len(S) - dfs(S))



### FIXED CODE ###

S = str(input())

s = S

zero = s.count('0')
one = s.count('1')

zero_one_diff = max(zero, one) - min(zero, one)
print(len(s) - zero_one_diff)
S = list(input())
K = int(input())
n = len(S)

#(方針)Sの「先頭(の連続)」と「末尾(の連続)」が同じ文字ならそこも連続に
#2連続→1回で置換できる,3連続→1回で置換できる,　「N連続→N//2回で置換できる」

A = [] #連続でちぎるようのリスト
count = 1
for i in range(n): 
 if(i != 0):
  if(S[i]== tmp): count += 1
  if((S[i] != tmp)or(i == n-1)):
    A.append([tmp,count])
    count = 1
 tmp = S[i]
if(n == 1): A.append(A[0],1)

ans = 0
for i in range(len(A)):
  if((i != 0)and(i != len(A)-1)):
   ans += (A[i][1]//2)*K
     
if(len(A) == 1):
   ans += (A[0][1]*K)//2  
elif(A[0][0] == A[-1][0]):
   ans += (A[0][1]//2) + (A[-1][1]//2) + ((A[0][1]+A[-1][1])//2)*(K-1) #最初の二項 : 結合後の先頭と末尾分 
elif(A[0][0] != A[-1][0]):
   ans += (A[0][1]//2)*K  
   ans += (A[-1][1]//2)*K
print(ans)     

### FIXED CODE ###

S = list(input())
K = int(input())
n = len(S)

#(方針)Sの「先頭(の連続)」と「末尾(の連続)」が同じ文字ならそこも連続に
#2連続→1回で置換できる,3連続→1回で置換できる,　「N連続→N//2回で置換できる」

A = [] #連続でちぎるようのリスト
count = 1
for i in range(n): 
 if(i != 0):
  if(S[i]== tmp): count += 1
  if((S[i] != tmp)or(i == n-1)):
    A.append([tmp,count])
    count = 1
 tmp = S[i]
if(n == 1): A.append([S[0],1])

ans = 0
for i in range(len(A)):
  if((i != 0)and(i != len(A)-1)):
   ans += (A[i][1]//2)*K
     
if(len(A) == 1):
   ans += (A[0][1]*K)//2  
elif(A[0][0] == A[-1][0]):
   ans += (A[0][1]//2) + (A[-1][1]//2) + ((A[0][1]+A[-1][1])//2)*(K-1) #最初の二項 : 結合後の先頭と末尾分 
elif(A[0][0] != A[-1][0]):
   ans += (A[0][1]//2)*K  
   ans += (A[-1][1]//2)*K
print(ans)
x = int(input())
for b in range(x):
	for p in range(x):
		if b >0 and p >=2:
			if b**p > x:
				break
			ans = b ** p
print(ans)

### FIXED CODE ###

x = int(input())

ans = 1
for b in range(1,32):
	for p in range(2,10):
		l = b**p
		if l <= x and l > ans:
			ans = l
print(ans)
A,B = map(int,input().split())
if A >= B:
	answer = A - 1
else:
	amswer = B -1
    
if A - 1 >= B - 1:
	answer = A - 2
else:
	amswer = B - 2
    
print(answer)

### FIXED CODE ###

A,B = map(int,input().split())

score = 0
if A >= B:
    score= score + A
    A = A - 1    
else:
    score = score + B
    B = B - 1

if A >= B:
    score = score + A
    A = A - 1
else:
    score = score + B
    B = B - 1
    
print(score)
S=input()

l=len(S)

ans=0
ans_list=()

for i in range(l):
    if S[i] in ("A","G","C","T"):
        ans+=1
    else:
        ans_list.append(ans)
        ans=0
ans_list.append(ans)
print(ans)
    

### FIXED CODE ###

s = input()
t = ''
for i in range(len(s)):
    if s[i] in ('A', 'C', 'G', 'T'):
        t += '1'
    else:
        t += '0'
"""
print(t)
print(t.split('0'))
"""

print(max(map(len, t.split('0'))))
A=input())
B=input())
C=input())

card={a:A,b:B,c:C}
answer=["a":"A","b":"B","c":"C"]
turn="a"

while True:
    if len(card[turn])==0:
        break
    next_turn=card[turn][0]
    card[turn]=card[turn][1:]
    turn=next_turn

print(answer[turn])

### FIXED CODE ###

A=input()
B=input()
C=input()

card={"a":A,"b":B,"c":C}
answer={"a":"A","b":"B","c":"C"}
turn="a"

while True:
    if len(card[turn])==0:
        break
    next_turn=card[turn][0]
    card[turn]=card[turn][1:]
    turn=next_turn

print(answer[turn])
def gcd(i,j):
  if i>j:
    i,j=j,i
  if j%i==0:
    return i
  return gcd(i,j-i)

n=int(input())
l=[int(i) for i in input().split()]
g=gcd(l[0],l[1])
for i in range(2,len(l)):
  g=gcd(g,l[i])
print(g)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

def gcd(i,j):
  if i>j:
    i,j=j,i
  if j%i==0:
    return i
  return gcd(j-i,i)

n=int(input())
l=[int(i) for i in input().split()]
l.sort()
g=gcd(l[0],l[1])
for i in range(2,len(l)):
  g=gcd(g,l[i])
print(g)
import sys
input = sys.stdin.readline

s = input().rstrip()

from collections import Counter

c = Counter(s)

if n == 1:
    print("YES")
    sys.exit()

if len(c.keys()) == 1:
    print("NO")
    sys.exit()

values = list(c.values())
values.sort()

if len(c.keys()) == 2:
    if values[0] == 1 and values[1] == 1:
        print("YES")
    else:
        print("NO")
    sys.exit()

values[1] -= values[0]
values[2] -= values[0]

if values[1] == 1 and values[2] == 1:
    print("YES")
elif values[1] == 0 and values[2] == 1:
    print("YES")
elif values[1] == 1 and values[2] == 0:
    print("YES")
else: 
    print("NO")
sys.exit()



### FIXED CODE ###

import sys
input = sys.stdin.readline

s = input().rstrip()

from collections import Counter

c = Counter(s)

if len(s) == 1:
    print("YES")
    sys.exit()

if len(c.keys()) == 1:
    print("NO")
    sys.exit()

values = list(c.values())
values.sort()

if len(c.keys()) == 2:
    if values[0] == 1 and values[1] == 1:
        print("YES")
    else:
        print("NO")
    sys.exit()

values[1] -= values[0]
values[2] -= values[0]

if values[1] == 1 and values[2] == 1:
    print("YES")
elif values[1] == 0 and values[2] == 1:
    print("YES")
elif values[1] == 1 and values[2] == 0:
    print("YES")
elif values[1] == 0 and values[2] == 0:
    print("YES")
else: 
    print("NO")
sys.exit()
N=int(input())
A=sorted(list(map(int,input().split())))
for i in range(N):
  if A[i] ==A[i+1]:
    print("NO")
  else:
    print("YES")

### FIXED CODE ###

N=int(input())
A=sorted(list(map(int,input().split())))
flag = False
for i in range(1,N):
  if A[i] == A[i-1]:
    flag = True
if flag:
  print("NO")
else:
  print("YES")
N, H, W = map(int,input().split())

count =0

for num in range(N):
  A, B = map(int,inp().split())
  if H >=A and W>=B:
    count +=1
print(count)


### FIXED CODE ###

N, H, W = map(int,input().split())
 
count =0
 
for num in range(N):
  A, B = map(int,input().split())
  if A >=H and B >= W:
    count +=1
print(count)
n=int(input())

L=[list(map(int,input().split())) for i in range(n)]
LSort=sorted(L,key=lambda x:x[2])
x,y,z=LS[-1]

for cx in range(1,101):
	for cy in range(1,101):
		H=h+abs(x-cx)+abs(y-cy)
		if all([h=max(H-abs(x-cx)-abs(y-cy),0) for x,y,h in LSort])
		print(cx,cy,H)
		exit()

### FIXED CODE ###

n=int(input())
 
L=[list(map(int,input().split())) for i in range(n)]
LSort=sorted(L,key=lambda x:x[2])
x,y,h=LSort[-1]

for cx in range(0,101):
	for cy in range(0,101):
		H=h+abs(x-cx)+abs(y-cy)
		if all([h==max(H-abs(x-cx)-abs(y-cy),0) for x,y,h in LSort]):
		    print(cx,cy,H)
		    exit()
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b = map(int, input().split())
print(a * b // gcd(a, b))


### FIXED CODE ###

import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B = MAP()

def euclid(a, b):
    if a < b:
        a, b = b, a
    while a % b != 0:
        a, b = b, a % b
    return b

print(A * B // euclid(A, B))
if __name__ == "__main__":
  s = input().split(" ")
  R = int(s[0])
  G = int(s[1])
  B = int(s[2])
  N = int(s[3])
  
  count = 0
  for i in range(N/R+1):
    sumR = R * i
    if sumR == N:
      count += 1
      break
    elif sumR > N:
      break
    else:
      for j in range(N/G+1):
        sumG = G * j
        if sumR + sumG == N:
          count += 1
          break
        elif sumR + sumG > N:
          break
        else:
          for k in range(N/B+1):
            sumB = B * k
            if sumR + sumG + sumB == N:
              count += 1
              break
            elif sumR + sumG + sumB > N:
              break
  print(count)

### FIXED CODE ###

import sys

if __name__ == "__main__":
	s = input().split(" ")
	print(int(s[0]) - (int(s[1]) - 1))
from operator import itemgetter
import bisect
import math

N,d,a = map(int, input().split())
xh = sorted([list(map(int, input().split())) for i in range(N)], key=itemgetter(0))
x = []
for X,h in xh:
  x.append(X)
data0 = [0]*(N+1)
data1 = [0]*(N+1)

def _add(data, k, x):
    while k <= N:
        data[k] += x
        k += k & -k
def add(l, r, x):
    _add(data0, l, -x*(l-1))
    _add(data0, r, x*(r-1))
    _add(data1, l, x)
    _add(data1, r, -x)

def _get(data, k):
    s = 0
    while k:
        s += data[k]
        k -= k & -k
    return s
def query(l, r):
    return _get(data1, r-1) * (r-1) + _get(data0, r-1) - _get(data1, l-1) * (l-1) - _get(data0, l-1)

ans = 0

for L,(X,H) in enumerate(xh):
  L += 1
  R = bisect.bisect_right(x,X+2*d)
  res = math.ceil((H - query(L,L+1) * a) / a) #ansを変える
  ans += res
  add(L,R+1,res)
print(ans)  


### FIXED CODE ###

import math

a,b = map(int, input().split())
print(math.ceil(a/b))
import itertools
 
x = int(input())
 
y = itertools.combinations(range(-100,100), 2)
i = 0
for n in y:
    if (n[0]**5 - n[1]**5) == x:
        print(n[0], n[1])
        break
    elif (n[1]**5 - n[0]**5) == x:
        print(n[1], n[0])
        break

### FIXED CODE ###

a = input()

if a == "ABC":
    print("ARC")
else:
    print("ABC")
def get_sum_arr(arr):
    sum_arr = [0]
    N = len(arr)
    for i in range(1,N+1):
        sum_arr.append(sum_arr[i-1] + arr[i-1])
    return sum_arr
def get_max_book_num(A,B,K):
    A_sum_arr,B_sum_arr = get_sum_arr(A),get_sum_arr(B)
    count,i,j = 0,0,0
    for i in range(0,len(A_sum_arr)):
        if K < A_sum_arr[i]:
            break
        else:
            while B_sum_arr[j] <= (K - A_sum_arr[i]):
                j += 1
            j -= 1
        count = max(count,(i+j))
    return count

if __name__ == "__main__":
    N,M,K = list(map(int,input().split()))
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
    A_sum_arr,B_sum_arr = get_sum_arr(A),get_sum_arr(B)
    print(get_max_book_num(A,B,K))
    


### FIXED CODE ###

def get_sum_arr(arr):
    sum_arr = [0]
    N = len(arr)
    for i in range(1,N+1):
        sum_arr.append(sum_arr[i-1] + arr[i-1])
    return sum_arr

def get_max_b(left_time,j,B_sum_arr):
    # [0,1,2,3,4,5]
    while B_sum_arr[j] > left_time and j > 0:
        j -= 1
    return j
def get_max_book_num(A,B,K):
    A_sum_arr,B_sum_arr = get_sum_arr(A),get_sum_arr(B)
    count,i,j = 0,0,len(B_sum_arr)-1
    for i in range(0,len(A_sum_arr)):
        if K < A_sum_arr[i]:
            break
        else:
            left_time = K - A_sum_arr[i]
            j = get_max_b(left_time,j,B_sum_arr)
        count = max(count,(i+j))
    return count
if __name__ == "__main__":
    N,M,K = list(map(int,input().split()))
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))
    print(get_max_book_num(A,B,K))