Harryxun/stf_run huggingface dataset:
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)

    # divisors.sort()
    return divisors

N = int(input())

n = []
n = make_divisors(N)

cnt = 999999999999999
for i in range(0,len(n),2):
    t = int(n[i])-1 + int(n[i+1])-1
    if cnt > t:
        cnt = t
print(cnt)



### FIXED CODE ###

def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    #table = list(set(table))
    table = list(table)
    table.sort()
    return table

N = int(input())

#for N in range(1000000000000):
n = []
n = divisor(N)
#print(n)

cnt = 999999999999999
for i in range(0,len(n)//2,1):
    t = int(n[i])-1 + int(n[len(n)-i-1])-1
    if cnt > t:
        cnt = t
print(cnt)
n = int(input())
tasks = []

for _ in range(n):
    c,d = map(int,input().split())
    tasks.append([d,c])
tasks.sort()
maxday = tasks[-1][0]
cul = [0] * maxday
for i in range(n):
    day = tasks[i][0]
    cost = tasks[i][1]
    if day - sum(cul[0:day+1]) < cost :
        print("No")
        exit()
    else:
        j = 0
        k = 0
        while k < cost:
            if cul[j] == 0:
                cul[j] = 1
                k += 1

            j += 1
    #print(cul)
print("Yes")

### FIXED CODE ###

n = int(input())
tasks = []

for _ in range(n):
    c,d = map(int,input().split())
    tasks.append([d,c])
tasks.sort()
maxday = tasks[-1][0]
worked = 0
for i in range(n):
    day = tasks[i][0]
    cost = tasks[i][1]
    if day - worked < cost :
        print("No")
        exit()
    else:
        worked += cost
print("Yes")
N=int(input())
A,B=map(int,input().split())
if N==1:
    print('Hello World')
elif N==2:
    print('A+B')

### FIXED CODE ###

N=int(input())
if N==1:
    print('Hello World')
else:
    A=int(input())
    B=int(input())
    print(A+B)
for line in sys.stdin:
    time = int(line)
    sec = time % 60
    rest = time / 60
    min = rest % 60
    hour = rest / 60
    print(str(int(hour)) + ":" + str(int(min)) + ":" + str(int(sec)))


### FIXED CODE ###

import sys


def num_rest(num, base):
    return num % base, num / base


for line in sys.stdin:
    time = int(line)
    sec, rest = num_rest(time, 60)
    min, hour = num_rest(rest, 60)
    print(str(int(hour)) + ":" + str(int(min)) + ":" + str(int(sec)))
import string
n = int(input())
s = input()
for c in s:
  print(string.ascii_uppercase[(ord(c)-ord('A')+n)%26)], end='')
print()

### FIXED CODE ###

import string
n = int(input())
s = input()
for c in s:
  print(string.ascii_uppercase[(ord(c)-ord('A')+n)%26], end='')
print()
H,W = map(int,input().split())
m = ["" for _ in range(H)] 
import queue
q = queue.Queue()

#sharps = []
for i in range(H):
    m[i] = input()
    for j in enumerate(m[i]):
        if j[1] == "#":
            q.put((i,j[0]))
            
times_map = [0] * (H*W)
bool_map = [0]* (H*W)

counter = -1
while sum(bool_map) != H*W:
    counter +=1
    sharps = [q.get() for _ in range(q.qsize())]
    for one in sharps:
        if one[0] < 0 or one[0] >= H or one[1] < 0 or one[1] >= W:
            continue
        index = one[0]*(H)+one[1]
        if bool_map[index] == 0:
            times_map[index] = counter
            bool_map[index] = 1
            q.put((one[0]+1,one[1]))
            q.put((one[0]-1,one[1]))
            q.put((one[0],one[1]+1))
            q.put((one[0],one[1]-1))
            
print(counter)

### FIXED CODE ###

import numpy as np
import sys
# https://atcoder.jp/contests/agc033/submissions/6021787
buf = sys.stdin.buffer
H,W = map(int,buf.readline().split())
# +1周分だけ
black = np.zeros((H+2,W+2),dtype=np.bool)
# \nがあることに注意
black[1:-1,1:] = (np.frombuffer(buf.read(H*(W+1)),dtype='S1') == b'#').reshape(H,W+1)

INF = 10 ** 4
dist = np.zeros((H,W),dtype=np.int16)
# .のところは０それ以外はINFで初期化
dist[~black[1:-1,1:-1]] = INF
# 右、左、下、上と展開させていく感じ
for n in range(1,H):
    np.minimum(dist[n-1]+1,dist[n],out=dist[n])
for n in range(H-2,-1,-1):
    np.minimum(dist[n+1]+1,dist[n],out=dist[n])
for n in range(1,W):
    np.minimum(dist[:,n-1]+1,dist[:,n],out=dist[:,n])
for n in range(W-2,-1,-1):
    np.minimum(dist[:,n+1]+1,dist[:,n],out=dist[:,n])

print(dist.max())
from math import gcd
from numpy import sign
mod = 1000000007
N = int(input())

if N == 1:
    print(1)
    
d = {}

search_list = []

for _ in range(N):
    a, b = list(map(int, input().split()))
    if a == b == 0:
        if (0, 0) not in d:
            d[(0, 0)] = 1
        else:
            d[(0, 0)] += 1
    else:
        g = gcd(a, b)

        a, b =  a / g, b /g
        if b < 0:
            a, b = -a, -b
        if b == 0:
            a, b =  1, 0
        if (a, b) not in d:
            d[(a, b)] =1
        else:
            d[(a, b)] +=1

answer = 1



for k in list(d.keys()):
    if k not in done_list and k != (0, 0):
        pair_k = (sign(k[0]) * (-1) * k[1], abs(k[0]))
        if pair_k not in d:
            answer *= (2 ** d[k]) % mod
            answer = answer % mod
            done_list += [k]
        else:
            answer *= ((2 ** d[k]) + (2 ** d[pair_k]) - 1) % mod
            answer = answer % mod
            done_list += [k, pair_k]

if (0, 0) in d:
    answer += d[(0, 0)]
    
print((answer - 1) % mod)

### FIXED CODE ###

from math import gcd
from numpy import sign
mod = 1000000007
N = int(input())

d = {}
counter = 0

f = 0
l = 0

for _ in range(N):
    a, b = list(map(int, input().split()))
    if a == b == 0:
        counter += 1
    elif a==0:
        f += 1
    elif b==0:
        l += 1
    else:
        g = gcd(a, b)
        a, b =  a // g, b //g
        if b < 0:
            a, b = -a, -b
        if (a, b) not in d:
            d[(a, b)] =1
        else:
            d[(a, b)] +=1

answer = 1

group = set()
for (p, q), v in d.items():
    invp,invq=-q,p
    if invq<0:
        invp,invq=-invp,-invq
    if not (invp,invq) in group:
        group.add((p,q))

for (p, q) in group:
    invp,invq=-q,p
    if invq<0:
        invp,invq=-invp,-invq
    if (invp, invq) not in d:
        answer *= (2 ** d[(p, q)])
    else:
        answer *= ((2 ** d[(p, q)]) + (2 ** d[(invp, invq)]) - 1)
        
answer *= 2**f + 2**l - 1
    
print((answer + counter - 1) % mod)
input1 = int(input())

from sympy import nextprime
print(nextprime(input1))


### FIXED CODE ###

# coding cell (SUBMIT ONLY THIS CELL)

import math

X = int(input())
temp = False

if X == 2:
    print(2)
    exit()

if X % 2 == 0:
    X += 1

while temp == False:

    for i in range(int(math.sqrt(X) // 2)):
        if X % (2 * (i + 1) + 1) != 0:
            temp = True
        else:
            temp = False
            break

    X += 2        
    
print(X - 2)
class ABC109Solver():
    def __init__(self):
        self.a = int()
        self.b = int()
    def input(self, a, b):
        self.a = a
        self.b = b
    def solve(self):
        # return 'Yes'
        # return 'No' if self.b%2 == 0 else 'Yes'
        return 'No' if self.a%2 == 0 or self.b%2 == 0 else 'Yes'
      
a = int(input())
b = int(input())
solver = ABC109Solver()

print( solver.solve() )

### FIXED CODE ###

class ABC109Solver():
    def __init__(self):
        self.a = int()
        self.b = int()
    def input(self, a, b):
        self.a = a
        self.b = b
    def solve(self):
        # return 'Yes'
        # return 'No' if self.b%2 == 0 else 'Yes'
        return 'No' if self.a%2 == 0 or self.b%2 == 0 else 'Yes'

vals = input().split(' ')
a, b = int(vals[0]), int(vals[1])
solver = ABC109Solver()
solver.input(a,b)
 
print( solver.solve() )
n = int(input())
p = [int(input()) for i in range(n)]
count =0
for s,t in enumerate(p):
	print(s,t)
	if s !=(t-1):
		count+=1
if count == 2 or count == 0:
	print("YES")
else:
	print("NO")

### FIXED CODE ###

n = int(input())
p = map(int, list((input().split())))
count =0
for s,t in enumerate(p):
	if s !=(t-1):
		count+=1
if count == 2 or count == 0:
	print("YES")
else:
	print("NO")
n = int(input())
d = [int(input()) for i in range(n)]
ans = []
 
for i in range(n):
    if d[i] not in ans:
        ans.append(d[i])
 
print(len(ans))

### FIXED CODE ###

S = input()
print("2018"+S[4::])
N=int(input())
i=list(map(int,input().split()))
a=0
for x in range(N):
    if i[x]%2==0:
        if i[x]%3!=0:
            if i[x]%5!=0:
                x+=1
if a==0:
    print("APPROVED")
else:
    print("DENIED")

### FIXED CODE ###

a,b,c=input().split()
 
if a==b==c:
  print("No")
elif a==b!=c:
  print("Yes")
elif a==c!=b:
  print("Yes")
elif a!=b==c:
  print("Yes")
else:
  print("No")
N = int(input())
W = [int(w) for w in input().split
ans = 10000000
for t in range(N):
  less_T = W[:t]
  more_T = W[t:]
  S_l = sum(less_T)
  S_m = sum(more_T)
  d = abs(S_l - S_m)
  if ans > d:
     ans = d
print(ans)

### FIXED CODE ###

N = int(input())
W = [int(w) for w in input().split()]
ans = 100000000
for t in range(N):
  less_T = W[:t]
  more_T = W[t:]
  S_l = sum(less_T)
  S_m = sum(more_T)
  d = abs(S_l - S_m)
  if ans > d:
     ans = d
print(ans)
# coding: utf-8
# Your code here!
S=list(input())[::-1]

count=0
temp=[]
pre=[]
while len(S)>3:
    temp.append(S.pop(-1))
    if temp==pre:
        temp.append(S.pop(-1))
    pre.clear()
    pre+=temp
    temp.clear()
    count+=1
if pre[-1]==S[2] or S[2]==S[1] or S[1]==S[0]:
    print(count+2)
else:
    print(count+3)


### FIXED CODE ###

# coding: utf-8
# Your code here!
S=list(input())[::-1]

count=0
temp=[]
pre=[]
while len(S)>3:
    temp.append(S.pop(-1))
    if temp==pre:
        temp.append(S.pop(-1))
    pre.clear()
    pre+=temp
    temp.clear()
    count+=1
#print(S[::-1])
if len(S)==3:
    if pre[-1]==S[2] or S[2]==S[1] or S[1]==S[0]:
        print(count+2)
    else:
        print(count+3)
else:
    if S[1]==S[0]:#aabbaが出来ればよい
        print(count+1)
    else:
        print(count+2)
a, b = [int(i) for i in input().split()]

    if (a*b) & 1:
        print('Odd')
    else :
        print('Even')

### FIXED CODE ###

a, b = [int(i) for i in input().split()]

if (a*b)%2 == 0 :
    print ("Even")
else:
    print ("Odd")
N = int(input())
H = list(map(int, input().split()))

for i in range(N-1):
    if H[i] - H[i+1] > 1:
        print('No')
        exit()

print('Yes')

### FIXED CODE ###

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

print(C - min(A-B, C))
from math import gcd      #3.5
def lcm(x, y):
    return (x * y) // gcd(x, y)

nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = n()
common = n()
for i in range(N-1):
    common = lcm(common, n())

print(common)



### FIXED CODE ###


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

nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = n()
common = n()
for i in range(N-1):
    common = lcm(common, n())

print(common)
import math

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

adivc = A//C
if A%C != 0:
    adivc = A//C + 1
bdivc = B//C
countC = bdivc - adivc + 1

adivd = A//D
if A%D != 0:
    adivd = A//D + 1
bdivd = B//D
countD = bdivd - adivd + 1

lcm = (int)(C * D / math.gcd(C, D))
adivlcm = A // lcm
if A%lcm != 0:
    adivlcm = A // lcm + 1
bdivlcm = B // lcm
countlcm = bdivlcm - adivlcm + 1

print(B-A+1-(countC+countD-countlcm))

### FIXED CODE ###

from fractions import gcd

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

adivc = A//C
if A%C != 0:
    adivc = A//C + 1
bdivc = B//C
countC = bdivc - adivc + 1

adivd = A//D
if A%D != 0:
    adivd = A//D + 1
bdivd = B//D
countD = bdivd - adivd + 1

lcm = (int)(C * D / gcd(C, D))
adivlcm = A // lcm
if A%lcm != 0:
    adivlcm = A // lcm + 1
bdivlcm = B // lcm
countlcm = bdivlcm - adivlcm + 1

print(B-A+1-(countC+countD-countlcm))
R=int(input())
print((int(input())*2-R)

### FIXED CODE ###

R=int(input())
print((int(input()))*2-R)
from heapq import nlargest
from itertools import accumulate

n = int(input())
aaa = list(map(int, input().split())) + [0]
aaa_get = aaa.__getitem__
n2 = 1 << n

dp = [[i, -1] for i in range(n2)]
for j in range(n):
    b = 1 << j
    for i in range(n2):
        if (i & b) == 0:
            dp[i | b] = nlargest(2, {*dp[i], *dp[i | b]}, key=aaa_get)
ans = list(accumulate(map(lambda x: sum(map(aaa_get, x)), dp[1:]), func=max))
print(*ans)


### FIXED CODE ###

n = int(input())
aaa = list(map(int, input().split()))
n2 = 1 << n
dp = [[a, 0] for a in aaa]

for j in range(n):
    b = 1 << j
    for i in range(n2):
        if not i & b:
            dpi, dpk = dp[i], dp[i | b]
            if dpk[0] < dpi[0]:
                dpk[1] = max(dpk[0], dpi[1])
                dpk[0] = dpi[0]
            elif dpk[1] < dpi[0]:
                dpk[1] = dpi[0]

ans = []
tmp = 0
for a in dp[1:]:
    tmp = max(tmp, a[0] + a[1])
    ans.append(tmp)
print(*ans)
N = int(input())
lis = list(map(int,input().split()))

m = min(lis)
lis.remove(min(lis))
m_2 = min(lis)
lis.remove(min(lis))
v = (m + m_2) / 2   

for i in range(0, N - 1):
    v = (v + min(lis)) / 2
    lis.remove(min(lis))

print(v)
    
    

### FIXED CODE ###

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

m = min(lis)
lis.remove(min(lis))
m_2 = min(lis)
lis.remove(min(lis))
v = (m + m_2) / 2   

for i in range(0, N - 2):
    v = (v + min(lis)) / 2
    lis.remove(min(lis))

print(v)
A,B = map(int, input().sprit())
C = A - B * 2
if C<0:
  print(0)  
else:
  print(C)

### FIXED CODE ###

A,B = map(int, input().split())
C = A - B * 2
if C<0:
  print(0)  
else:
  print(C)
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

dis = abs(A-b)
v = V-W

if v >= 0 and dis/v <= T:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

dis = abs(A-B)
v = V-W

if v > 0 and dis/v <= T:
  	print("YES")
else:
  print("NO")
n,t=map(int,input().split())
a=list(map(int,input().split()))
y=max(a)+10+t
b=[0]*y
c=[0]*y
for i in a:
    b[i]+=1
    b[i+t]-=1
for i in range(len(b)):
    if i!=0:
        b[i]+=b[i-1]
d=[i for i in b if i>0]
print(len(d))


### FIXED CODE ###

n,t=map(int,input().split())
a=list(map(int,input().split()))
ans=t
for i in range(1,n):
    ans+=min(t,a[i]-a[i-1])
print(ans)
n = int(input())
stat2id = {
  "AC": 0,
  "WA": 1,
  "TLE": 2,
  "RE": 3,
}
id2stat = {i:s for s,i in stat2id.items()}
count = [0 for _ in range(4)]

for i in range(n):
  s = input()
  count[s] += 1
for i, c in enumerate(count):
  print(id2stat[i], "x", c)

### FIXED CODE ###

n = int(input())
stat2id = {
  "AC": 0,
  "WA": 1,
  "TLE": 2,
  "RE": 3,
}
id2stat = {i:s for s,i in stat2id.items()}
count = [0 for _ in range(4)]

for i in range(n):
  s = input()
  count[stat2id[s]] += 1
for i, c in enumerate(count):
  print(id2stat[i], "x", c)
a,　p=map(int,input().split())
ans=(a*3+b)//2
print(ans)


### FIXED CODE ###

a,p=map(int,input().split())
ans=(a*3+p)//2
print(ans)
# なぜか途中からREなる...
n = int(input())
s = list(map(int, input().split()))
color = 0  # appeared_zero (0~2)
ans = 1
MOD = 1000000007
cur = [-1, -1, -1]
for c in s:
    if c == 0:
        cur[color] = 0
        color += 1
        ans %= MOD
    else:
        x = cur.count(c - 1)
        ans *= x
        ans %= MOD
        if c - 1 in cur:
            idx = cur.index(c - 1)
            cur[idx] += 1
        else:
            print("????????????")
            exit()
ans *= 3 if color == 0 else 3 if color == 1 else 6
ans %= MOD
print(ans)


### FIXED CODE ###

# なんか雑に書いたらサンプル3通ったしこれでよさそう
# なんかしらんけど2ケースでWAなる
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 1
d = [0] * (n + 10)
d[0] = 3
for i in range(n):
    ans *= d[a[i]]
    d[a[i]] -= 1
    d[a[i] + 1] += 1
    ans %= mod
print(ans)
S = int(input())
if S == AAA or BBB:
  print("No")
else:
  print("Yes")


### FIXED CODE ###

S = input()
if S == "AAA" or S == "BBB":
  print("No")
else:
  print("Yes")
a = list(input())
ans = []
for i in range(len(a)):
    if a[i] == '0':
        ans.append('0')
    elif a[i] == '1':
        ans.append('1')
    elif a[i] == 'B':
        if ans == []:
            continue
        else:
            i -= 1
            ans.remove(ans[i])
print(''.join(ans))

### FIXED CODE ###

a = list(input())
ans = []
for i in range(len(a)):
    if a[i] == '0':
        ans.append('0')
    elif a[i] == '1':
        ans.append('1')
    elif a[i] == 'B':
        if ans == []:
            continue
        else:
            ans.pop(-1)
print(''.join(ans))
def solve(X,Y):
    res=''
    n,m=len(X),len(Y)
    dp=[[0]*(m+1) for i in range(m+1)]
    for i in range(n):
        for j in range(m):
            if(X[i]==Y[j]):
                dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j]+1)
            dp[i+1][j+1]=max([dp[i+1][j+1],dp[i][j+1],dp[i+1][j]])
    i,j=i+1,j+1
    while(i>0 and j>0):
        if(dp[i][j]==dp[i-1][j]):
            i-=1
        elif(dp[i][j]==dp[i][j-1]):
            j-=1
        else:
            i-=1;j-=1
            res+=X[i]
    return res[::-1]

def main():
    X=input()
    Y=input()
    print(solve(X,Y))

if __name__=='__main__':
    main()

### FIXED CODE ###

def solve(X,Y):
    res=''
    n,m=len(X),len(Y)
    dp=[[0]*(m+1) for i in range(n+1)]
    for i in range(n):
        for j in range(m):
            if(X[i]==Y[j]):
                dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j]+1)
            dp[i+1][j+1]=max([dp[i+1][j+1],dp[i][j+1],dp[i+1][j]])
    i,j=i+1,j+1
    while(i>0 and j>0):
        if(dp[i][j]==dp[i-1][j]):
            i-=1
        elif(dp[i][j]==dp[i][j-1]):
            j-=1
        else:
            i-=1;j-=1
            res+=X[i]
    return res[::-1]

def main():
    X=input()
    Y=input()
    print(solve(X,Y))

if __name__=='__main__':
    main()
n, q = map(int, input().split())

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

cnt = [0 for _ in range(n)]
for i in range(q):
    p, x = map(int, input().split())
    cnt[p-1] += x


def dfs(now, bef):
    for nxt in edge[now-1]:
        if nxt != bef:
            cnt[nxt-1] += cnt[now-1]
            dfs(nxt, now)


dfs(1, -1)
print(*cnt)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)


def input(): return sys.stdin.readline()


N, Q = map(int, input().split())
ab = [[] for _ in range(N)]
for i in range(N-1):
  a, b = map(int, input().split())
  ab[a-1].append(b)
  ab[b-1].append(a)

P = [0 for _ in range(N)]
for i in range(Q):
  p, x = map(int, input().split())
  P[p-1] += x


def dfs(p, par):
  for i in ab[p-1]:
    if i != par:
      P[i-1] += P[p-1]
      dfs(i, p)


dfs(1, -12345)
print(" ".join(map(str, P)))
import math
N=int(input())
a=list(map(int,input().split()))
c=[]
for i in range(N+1):
  if a[i] in c:
    b=a[i]
    j=c.index(a[i])
    k=i
    L=j+N-k
    break
  c+=[a[i]]
Base=N+1
Minu=1
for i in range(0,min(L+1,N+1)):
  print((Base-Minu)%(10**9+7))
  Base=int(Base*(N-i)/(i+2))
  Minu=int(Minu*(L-i)/(i+1))
  #print(int(math.factorial(N+1)/(math.factorial(i+1)*math.factorial(N-i))-math.factorial(L)/(math.factorial(i)*math.factorial(L-i))))
for i in range(L+1,N+1):
  print(Base%(10**9+7))
  Base=int(Base*(N-i)/(i+2))

### FIXED CODE ###

N=int(input())
a=list(map(int,input().split()))
b=[]
if N%2==0:
  for i in range(int(N/2)):
    b+=[a[N-1-2*i]]
  for i in range(int(N/2)):
    b+=[a[2*i]]
else:
  for i in range(int((N+1)/2)):
    b+=[a[N-1-2*i]]
  for i in range(int((N-1)/2)):
    b+=[a[2*i+1]]
print(' '.join(map(str, b)))
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = 0
cnt = 0
cost = 0
for i, x in enumerate(a):
    cost += x
    if cost > k:
        cnt = i
        cost -= x
        break
else:
    for j, y in enumerate(b):
        cost += y
        if cost > k:
            cnt = n + j
            cost -= y
            break
    else:
        ans = n + m

if cnt <= n:
    i, j = cnt - 1, 0
else:
    i, j = n - 1, cnt - n + 1

while True:
    if cost == 0: break
    if i == n or j == -1: break
    while cost + b[j] <= k:
        j += 1
        cnt += 1
        cost += b[j]
    cost += - a[i] + b[j]
    i, j = i - 1, j + 1
    if cost > k: break
if ans != 0:
    print(ans)
else:
    print(cnt)

### FIXED CODE ###

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

cnt = 0
cost = 0
for i, x in enumerate(a):
    cost += x
    if cost > k:
        cnt = i
        cost -= x
        break
else:
    for j, y in enumerate(b):
        cost += y
        if cost > k:
            cnt = n + j
            cost -= y
            break
    else:
        cnt = n + m

if cnt <= n:
    i_max, j = cnt - 1, 0
else:
    i_max, j = n - 1, cnt - n

while j < m and cost + b[j] <= k:
    cost += b[j]
    j += 1
    cnt += 1

ans = cnt
for i in range(i_max, -1, -1):
    if j == m: break
    cost -= a[i]
    cnt -= 1
    while j < m and cost + b[j] <= k:
        cost += b[j]
        j += 1
        cnt += 1

    ans = max(cnt, ans)

print(ans)
r = int(input())
print(2*pi*r)

### FIXED CODE ###

r = int(input())
print(2*3.1415*r)
s = input()
c = 0
for i in 'abc': if s.count(i) == 1: c += 1
print('Yes' if c == 3 else 'No')

### FIXED CODE ###

s = input()
c = 0
for i in 'abc':
  if s.count(i) == 1:
    c += 1
print('Yes' if c == 3 else 'No')
S = input()

counter = []
cnt_dict = {'R':0, 'L':0}
for i in range(len(S)):
    l = S[i]
    if l == 'R':
        if cnt_dict['L'] == 0:
            cnt_dict[l] += 1
        else :
            counter.append(cnt_dict)
            cnt_dict = {'R':0, 'L':0}
            cnt_dict[l] += 1
    else :
        cnt_dict[l] += 1
counter.append(cnt_dict)
        
output = []
for c in counter:
    block_R = [0 for _ in range(c['R'])]
    block_L = [0 for _ in range(c['L'])]
    q, r = divmod((c['R'] + c['L']), 2)
    if r == 0:
        block_R[-1] = q
        block_L[0] = q
    else :
        if c['R'] % 2 == 0:
            block_R[-1] = q
            blcok_L[0] = q + r
        else :
            block_R[-1] = q + r
            block_L[0] = q
    
    
    output += block_R
    output += block_L
    
print(' '.join(map(str,output)))


### FIXED CODE ###

S = input()

counter = []
cnt_dict = {'R':0, 'L':0}
for i in range(len(S)):
    l = S[i]
    if l == 'R':
        if cnt_dict['L'] == 0:
            cnt_dict[l] += 1
        else :
            counter.append(cnt_dict)
            cnt_dict = {'R':0, 'L':0}
            cnt_dict[l] += 1
    else :
        cnt_dict[l] += 1
counter.append(cnt_dict)
        
output = []
for c in counter:
    block_R = [0 for _ in range(c['R'])]
    block_L = [0 for _ in range(c['L'])]
    q, r = divmod((c['R'] + c['L']), 2)
    if r == 0:
        block_R[-1] = q
        block_L[0] = q
    else :
        if c['R'] % 2 == 0:
            block_R[-1] = q
            block_L[0] = q + r
        else :
            block_R[-1] = q + r
            block_L[0] = q
    
    
    output += block_R
    output += block_L
    
print(' '.join(map(str,output)))
import math
A,B,C,D=map(int,input().split())

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

BdivC=B//C
BdivD=B//D
BdivCD=B//(lcm(C,D))
AdivC=(A-1)//C
AdivD=(A-1)//D
AdivCD=(A-1)//(lcm(C,D))

"""
print(BdivC)
print(BdivD)
print(AdivC)
print(AdivD)
print(BdivCD)
print(AdivCD)
"""

ans=B-(A-1)-(BdivC-AdivC+BdivD-AdivD-BdivCD+AdivCD)

print(ans)

### FIXED CODE ###

import fractions
A,B,C,D=map(int,input().split())

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

BdivC=B//C
BdivD=B//D
BdivCD=B//(lcm(C,D))
AdivC=(A-1)//C
AdivD=(A-1)//D
AdivCD=(A-1)//(lcm(C,D))

ans=B-(A-1)-(BdivC-AdivC+BdivD-AdivD-BdivCD+AdivCD)

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

cnt = [0] * (2*(10 ** 5) + 10) 
for i in range(N):
    if A[i]+1 >= 2*(10 ** 5):
        continue
    cnt[A[i]+i] += 1

ans = 0
for i in range(N)[1:]:
    if A[i]-i >= 0:
        continue
    ans += cnt[abs(A[i]-i)]

print(ans)

### FIXED CODE ###

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

cnt = [0] * (2*(10 ** 5) + 10) 
for i in range(N):
    if A[i]+i >= 2*(10 ** 5):
        continue
    cnt[A[i]+i] += 1

ans = 0
for i in range(N)[1:]:
    if A[i]-i >= 0:
        continue
    ans += cnt[abs(A[i]-i)]

print(ans)