Harryxun/stf_run huggingface dataset:
n=int(input())
a=list(map(int,input().split()))
ans=0
j=0
b=0
for  i in range(n):
    while j<n and b^a[j]==b+a[jl:
        b^=a[j]
        j+=1
    ans+=j-i    
    b^=a[i]
print(ans)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
ans=0
j=0
b=0
for  i in range(n):
    while j<n and b^a[j]==b+a[j]:
        b^=a[j]
        j+=1
    ans+=j-i    
    b^=a[i]
print(ans)
N,Y=map(int, input().split())
ichiman=0
gosen=0
sen=0
a=0
for i in range(N+1):
  for j in range(N+1-i):
    for k in range(N+1-i-j):
      if 10000*i+5000*j+1000*k==Y and i+j+k==N:
        a=1
        ichiman=i
        gosen=j
        sen=k
        print(str(i)+' '+str(j)+' '+str(k))
        exit()
    
print('-1 -1 -1')

### FIXED CODE ###

S=input()
S_array=S.split('/')
print('2018/'+S_array[1]+'/'+S_array[2])
import math
n = int(input())
root = math.ceil(math.sqrt(n))
nums = []
for i in range(1,root+1):
  if n % i == 0:
    count_i = len(str(i))
    count_j = len(str(j))
    ans = max(count_i,count_j)  
    nums.append(ans) 
nummm = sorted(nums,reverse = True)
print(nummm[0])

### FIXED CODE ###

import math
n = int(input())
root_n = math.ceil(math.sqrt(n))
f = []
for i in range(1,root_n+1):
  if n % i == 0:
    f_pair = max(len(str(int(i))),len(str(int(n/i))))
    f.append(f_pair)
mini = min(f)
print(mini)
A, B, C = map(int, input())
print("Yes" if A + B >= C else "No")


### FIXED CODE ###

A, B, C = map(int, input().split())
print("Yes" if A + B >= C else "No")
n,k = map(int, input().split())
Tree = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    Tree[a-1].append(b-1)
    Tree[b-1].append(a-1)
#print(Tree)

mod = 10**9+7
def dfs(cur, pre):
    ret = 1
    nodecnt = 0 if pre == -1 else 1

    for nd in Tree[cur]:
        #print("現在のnode:",nd)
        if nd == pre: continue
        nodecnt += 1
        ret = ret*(k-nodecnt)%mod
        ret = ret*dfs(nd, cur)%mod
    return ret%mod

print(k*dfs(0,-1)%mod)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100005)
n,k = map(int, input().split())
Tree = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    Tree[a-1].append(b-1)
    Tree[b-1].append(a-1)
#print(Tree)

mod = 10**9+7
def dfs(cur, pre):
    ret = 1
    nodecnt = 0 if pre == -1 else 1
    if cur > n-1 or cur < 0: return 0
    for nd in Tree[cur]:
        #print("現在のnode:",nd)
        if nd == pre: continue
        nodecnt += 1
        ret = ret*(k-nodecnt)%mod
        ret = ret*dfs(nd, cur)%mod
    return ret%mod

print(k*dfs(0,-1)%mod)
N, C = map(int, input().split())

tt = [[0] * (10 ** 5 + 1) for _ in range(C)]
for _ in range(N):
    s, t, c = map(int, input().split())
    for i in range(s - 1, t):
        tt[c - 1] = 1

ct = [0] * (10 ** 5 + 1)
for i in range(C):
    for j in range(10 ** 5 + 1):
        ct[j] += tt[i][j]

print(max(ct))


### FIXED CODE ###

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

tt = [[0] * (2 * 10 ** 5 + 1) for _ in range(30)]
for _ in range(N):
    s, t, c = map(int, input().split())
    ttc = tt[c - 1]
    for i in range(s * 2 - 1, t * 2):
        ttc[i] = 1

ct = [0] * (2 * 10 ** 5 + 1)
for i in range(30):
    tti = tt[i]
    for j in range(2 * 10 ** 5 + 1):
        ct[j] += tti[j]

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

student = list()

for x in range(n):
    student.append(list(map(int, input().split())))

checkpoint = list()

for y in range(m):
    checkpoint.append(list(map(int, input().split())))

tmp = 10**8+1

for x in range(n):
    for y in range(m-1, -1, -1):
        distance = abs(student[x][0] - checkpoint[y][0]) + \
            abs(student[x][1] - checkpoint[y][1])
        if tmp >= distance:
            tmp = distance
            ans = y
    print(ans+1)


### FIXED CODE ###

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

student = list()

for x in range(n):
    student.append(list(map(int, input().split())))

checkpoint = list()

for y in range(m):
    checkpoint.append(list(map(int, input().split())))

INF = 4*(10**8) + 1
tmp = INF
ans = 51

for x in range(n):
    for y in range(m-1, -1, -1):
        distance = abs(student[x][0] - checkpoint[y][0]) + \
            abs(student[x][1] - checkpoint[y][1])

        if tmp >= distance:
            tmp = distance
            ans = y
    print(ans+1)
    tmp = INF
n=input()
a=[int(x) for x in input().split()]
ans=0
for i in range(n):
  for j in range(i+1, n):
    ans=max(ans, abs(a[i]-a[j]))
print(ans)

### FIXED CODE ###

n=int(input())
a=[int(x) for x in input().split()]
ans=0 
for i in range(n):
  for j in range(i+1, n):
    ans=max(ans, abs(a[i]-a[j]))
print(ans)
def main():
    from sys import stdin
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    S = input()
    Q = int(input())
    mae = ''
    usiro = ''
    s = True
    for _ in range(Q):
        q = stdin.readline()
        if q[0]=='1':
            s = not s
        else:
            if q[2]=='1' and s:
                mae = q[4] + mae
            elif q[2]=='2' and s:
                usiro = usiro + q[4] 
            elif q[2]=='2' and not s:
                mae = q[4] + mae
            else:
                usiro = usiro + q[4]
    if s:
        print(mae+S+usiro)
    else:
        print(usiro[::-1]+S[::-1]+mae[::-1])




if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    import sys
    #input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations
    #from itertools import accumulate, product
    from bisect import bisect_left,bisect_right
    from math import floor, ceil
    #from operator import itemgetter

    #mod = 1000000007

    S = input()
    Q = int(input())
    mae = ''
    usiro = ''
    s = True
    for _ in range(Q):
        q = list(input().split())
        if q[0]=='1':
            s = not s
        else:
            if q[1]=='1' and s:
                mae = q[2] + mae
            elif q[1]=='2' and s:
                usiro = usiro + q[2] 
            elif q[1]=='2' and not s:
                mae = q[2] + mae
            else:
                usiro = usiro + q[2]
    if s:
        print(mae+S+usiro)
    else:
        print(usiro[::-1]+S[::-1]+mae[::-1])




if __name__ == '__main__':
    main()
n = int(input())
h = list(map(int, input().split()))
ans = []

for i in range(n-1):
    if h[i]>=h[i+1]:
        ans.append(1)
    else:
        ans.append(0)

count = 0
s = []
for i in range(len(ans)):
    if ans[i]==1:
        count += 1
    else:
        s.append(count)
        count = 0
        continue
    s.append(count)

print(max(s))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
ans = []

for i in range(n-1):
    if h[i]>=h[i+1]:
        ans.append(1)
    else:
        ans.append(0)

count = 0
s = []
for i in range(len(ans)):
    if ans[i]==1:
        count += 1
    else:
        s.append(count)
        count = 0
        continue
    s.append(count)

if s:
    print(max(s))
else:
    print(0)
import numpy as np
from numba import njit

@njit
def solve(A, F, K):
    lo = 0
    hi = 10 ** 12
    while lo < hi:
        mid = (lo + hi) // 2
        total_train = 0
        for i in range(A.shape[0]):
            need = A[i] - mid // F[i]
            total_train += need if need > 0 else 0
        if total_train <= K:
            hi = mid
        else:
            lo = mid + 1
    return lo

stdin = np.fromstring(open(0).read(), dtype=np.int64, sep=' ')
N, K = stdin[:2]
A = stdin[2: 2 + N]
F = stdin[2 + N:]
print(solve(np.sort(A)[::-1], np.sort(F), K))

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
F = list(map(int, input().split()))
A.sort()
F.sort(reverse=True)

q = [0] * N
start = 0
end = 0
for i in range(N):
    q[i] = A[i] * F[i]
    end = max(end, q[i])

def check(now, K):
    cnt = 0
    for i in range(N):
        if q[i] - now > 0:
            cnt += (q[i] - now + F[i] - 1) // F[i]
            if cnt > K:
                return False
    return True

now = end // 2
while end > start + 1:
    if check(now, K):
        end = now
    else:
        start = now
    now = (start + end) // 2

if check(start, K):
    print(start)
else:
    print(end)
#include <bits/stdc++.h>

using namespace std;

const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
typedef long long ll;

const int maxn = 110;

int N;

vector<unordered_map<string, ll>> memo(maxn);

bool check(string last4) {
    if (last4.find("AGC") != string::npos) {
        return false;
    }
    for (int i = 0; i < 4 - 1; ++i) {
        swap(last4[i], last4[i + 1]);
        if (last4.find("AGC") != string::npos) {
            return false;
        }
        swap(last4[i], last4[i + 1]);
    }
    return true;
}

ll dfs(int cur, const string& last3) {
    if (memo[cur].count(last3)) {
        return memo[cur][last3];
    }
    if (cur == N) {
        return 1;
    }
    ll ret = 0;
    for (char c : string("ACGT")) {
        if (check(last3 + c)) {
            ret = (ret % MOD + dfs(cur + 1, last3.substr(1) + c) % MOD) % MOD;
        }
    }
    return memo[cur][last3] = ret;
}

int main() {
    cin >> N;
    cout << dfs(0, "TTT") << endl;
    return 0;
}

### FIXED CODE ###

N, MOD = int(input()), 10 ** 9 + 7
memo = [{} for i in range(N + 1)]

def ok(last4):
    for i in range(4):
        t = list(last4)
        if i >= 1:
            t[i - 1], t[i] = t[i], t[i - 1]
        if ''.join(t).count('AGC') >= 1:
            return False
    return True

def dfs(cur, last3):
    if last3 in memo[cur]:
        return memo[cur][last3]
    if cur == N:
        return 1
    ret = 0
    for c in 'AGCT':
        if ok(last3 + c):
            ret = (ret + dfs(cur + 1, last3[1:] + c)) % MOD
    memo[cur][last3] = ret
    return ret

print(dfs(0, 'TTT'))
from sys import stdin, setrecursionlimit
# input = stdin.readline
setrecursionlimit(200000)
N, M = map(int, input().split())
# d = [0] * (N + 1)
adj = [[] for _ in range(N + 1)]
for _ in range(M):
    x, y = map(int, input().split())
    adj[x].append(y)
    # d[y] += 1

dp = [-1] * (N + 1)


def lp(x: 'int') -> 'int':
    if dp[x] >= 0:
        return dp[x]
    else:
        dp[x] = 0
        for y in adj[x]:
            dp[x] = max(dp[x], lp(y) + 1)
        return dp[x]


print(max(lp(i) for i in range(1, N + 1)))


### FIXED CODE ###

"""
https://atcoder.jp/contests/dp/tasks/dp_a
"""
from sys import stdin

n = int(input())
h = list(map(int, stdin.readline().strip().split()))

dp = [float('inf') for _ in range(n)]

dp[0] = 0
dp[1] = abs(h[1] - h[0])
for i in range(2, n):
    dp[i] = min(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]),
                dp[i - 2] + abs(h[i] - h[i - 2]))

print(dp[n - 1])
S = input()
if S[0] == S[1] and S[1]== S[2] == :
    print("no")
else:
    print("yes")


### FIXED CODE ###

s = input()
if s == "AAA" or s == "BBB":
    print("No")
else:
    print("Yes")
from fractions import gcd


l, r = map(int, input().split())
lr_ans = []
for i in range(l, r+1):
    lr_ans.append(i%2019)
lr_ans.sort()
print(int(lr_ans[0]*lr_ans[1]/gcd(lr_ans[0], lr_ans[1])))

### FIXED CODE ###

l, r = map(int, input().split())
lr_ans = []
if r - l  >= 2019:
    print(0)
    exit()
for i in range(l, r+1):
    for j in range(i+1, r+1):
        lr_ans.append((i*j)%2019)
print(min(lr_ans))
N=int(input())
a=[int(i) for i in input().split()]
ans=0
flag=0
for i in range(1,N):
  if flag==0 and a[i]==a[i-1]:
    ans+=1
    a[i]=a[i+1]+1
print(ans)

### FIXED CODE ###

N=int(input())
a=[int(i) for i in input().split()]
a.append(1)
ans=0
for i in range(1,N):
  if a[i]==a[i-1]:
    ans+=1
    a[i]=a[i+1]+1
print(ans)
S, W = map(int(input().split()))
if W >= S:
    print("unsafe")
else:
    print("safe")

### FIXED CODE ###

S, W = map(int, input().split())
if W >= S:
    print("unsafe")
else:
    print("safe")
N=int(input())
tmp=input()
tmp=tmp.split(' ')
a=[]
for i in range(N):
  a.append(int(tmp[i]))
  
if all(x % 2 == 0 for x in a) == False:
  print(0)
else:
  count=0
  while all(x % 2 == 0 for x in a) == True:
    a=[x/2 for x in a]
    count+=1
    
  print(count)

### FIXED CODE ###

s=input()
a,b,c=s[0],s[1],s[2]

print(int(a)+int(b)+int(c))
import sys
input = sys.stdin.readline

S = str(input())
N = len(S)-1


N1 = (N-1)/2
N2 = (N+3)/2

s1 = S[:N]
s2 = S[:N1]
s3 = S[N2-1:N]

flag = True
for ss in [s1, s2, s3]:
    ss_l = len(ss)
    for i in range(ss_l):
        if ss[i] != ss[ss_l-i-1]:
            flag = False
            break
    if not flag:
        break

if flag:
    print('Yes')
else:
    print('No')



### FIXED CODE ###

import sys
input = sys.stdin.readline

S = str(input())
N = len(S)-1

N1 = int((N-1)/2)
N2 = int((N+3)/2)

s1 = S[:N]
s2 = S[:N1]
s3 = S[N2-1:N]

flag = True
for ss in [s1, s2, s3]:
    ss_l = len(ss)
    for i in range(ss_l):
        if ss[i] != ss[ss_l-i-1]:
            flag = False
            break
    if not flag:
        break

if flag:
    print('Yes')
else:
    print('No')
N, A, B = [int(i) for i in input().split()]

ans = []
for _ in range(10**18):
    ans.append("b"*A)
    ans.append("r"*B)
    
    if len("".join(ans)) >= N:
        break

ans = "".join(ans)
print(ans[:N].count("b"))

### FIXED CODE ###

N, A, B = [int(i) for i in input().split()]
ans = N // (A + B) * A
r = N % (A + B)
print(ans+min(r, A))
a,b=int(input())
if (0<a<10　and 0<b<10):
  return a*b
else:
  return -1


### FIXED CODE ###

a,b=map(int, input().split())
if 0<a<10 and 0<b<10:
	print(a*b)
else:
	print('-1')
N, M = map(int, input().split())
parent = [-1] * N


def union(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return
    parent[x] = y


def find(x):
    if parent[x] == -1:
        return x
    res = parent[x] = find(parent[x])
    return res

for _ in range(M):
    a, b = map(int, input().split())
    union(a - 1, b - 1)


count = {}
for i in range(N):
    if (g := find(i)) in count:
        count[g] += 1
    else:
        count[g] = 1
res = 0
for value in count.values():
    res = max(res, value)
print(res)


### FIXED CODE ###

from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)


N, M = map(int, input().split())
parent = [-1] * N


def union(x, y):
    x = find(x)
    y = find(y)
    if x == y:
        return
    parent[x] = y


def find(x):
    if parent[x] == -1:
        return x
    res = parent[x] = find(parent[x])
    return res

for _ in range(M):
    a, b = map(int, input().split())
    union(a - 1, b - 1)


count = Counter(find(i) for i in range(N))
print(count.most_common(1)[0][1])
a=input().split()
pl1=int(a[0])
pl0=int(a[1])
pl_1=int(a[2])
draw=int(a[3])
#print(pl1,pl0,pl_1,draw)
if(pl1>=draw):
  print(draw)
elif(pl1+pl0>=draw):
  print(pl1)
else:
  all_card=pl1+pl0+pl_1
  #print(all_card)
  draw_pl_1=all_card-draw
  #print(draw_pl_1)
  print(pl1-draw_pl_1)

### FIXED CODE ###

a=input()
b=input()
if(a == b[:-1]):
  print('Yes')
else:
  print('No')
n,m=map(int,input().split())
li = []
h=list(map(int,input().split()))
for i in range(m):
    a,b=map(int,input().split())
    if h[a-1]<h[b-1]:
        li.append(a)
    elif h[a-1]==h[b-1]:
        li.append(a)
        li.zppend(b)
    else:
        li.append(b)
print(n-len(set(li)))


### FIXED CODE ###

from collections import deque
n,m=[int(_) for _ in input().split()]
H=[int(_) for _ in input().split()]
Hlist=deque(deque() for a in range(n))
count=0
for a in range(m):
    a,b=[int(_) for _ in input().split()]
    Hlist[a-1].append(b-1)
    Hlist[b-1].append(a-1)
for i,j in enumerate(Hlist):
    flag=1
    for a in j:
        if H[a]>=H[i]:
            flag=0
    if flag==1:
        count+=1
    flag=1
print(count)
N = int(input())
a=list(map(int, input().split()))
cnt=[0]*(max(a)+1)
for i in range(N):
    cnt[a[i]]+=1
#print(cnt)

tri=[cnt[i]+cnt[i+1]+cnt[i+2] for i in range(len(cnt)-2)]
#print(tri)
print(max(tri))

### FIXED CODE ###

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

if max(a)<=1:
    print(N)
else:
    cnt=[0]*(max(a)+1)
    for val in a:
        cnt[val]+=1
    #print(cnt)

    tri=[cnt[i]+cnt[i+1]+cnt[i+2] for i in range(len(cnt)-2)]
    #print(tri)
    print(max(tri))
from collections import Counter


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


if len(set(lst_v)) == 1:
    ans = n // 2
else:
    lst_odd = lst_v[::2]
    lst_even = lst_v[1::2]
    cnt_odd = sorted(Counter(lst_odd).items(), key=lambda x: -x[1])
    cnt_even = sorted(Counter(lst_even).items(), key=lambda x :-x[1])
    o1 = cnt_odd[0]
    e1 = cnt_even[0]
    o2 = cnt_odd[1] if cnt_odd[1] else (0, 0)
    e2 = cnt_even[1] if cnt_even[1] else (0, 0)

    if o1[0] == e1[0]:
        rem_number = max(o1[1] + e2[1], o2[1] + e1[1])
    else:
        rem_number = o1[1] + e1[1]
    sum_odd = sum(t[1] for t in cnt_odd)
    sum_even = sum(t[1] for t in cnt_even)
    ans = sum_odd + sum_even - rem_number


print(ans)


### FIXED CODE ###

from collections import Counter, OrderedDict


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


if len(set(lst_v)) == 1:
    ans = n // 2
else:
    lst_odd = [lst_v[i] for i in range(n) if i%2==0]
    lst_even = [lst_v[i] for i in range(n) if i%2!=0]
    cnt_odd = sorted(Counter(lst_odd).items(), key=lambda x: -x[1])
    cnt_even = sorted(Counter(lst_even).items(), key=lambda x :-x[1])

    if cnt_odd[0][0] == cnt_even[0][0]:
        rem_number = max(cnt_odd[0][1] + cnt_even[1][1], cnt_odd[1][1] + cnt_even[0][1])
    else:
        rem_number = cnt_odd[0][1] + cnt_even[0][1]
    sum_odd = sum(t[1] for t in cnt_odd)
    sum_even = sum(t[1] for t in cnt_even)
    ans = sum_odd + sum_even - rem_number


print(ans)
a=input()
b=len(a)
i=0
j=0
while i <= b//2 :
	if a[i] != a[b-i-1]:
	j +=1
else:
	print(j)

### FIXED CODE ###

a=input()
b=len(a)
i=0
j=0
while i <= b//2-1 :
	if a[i] != a[b-i-1]: 
		j+=1
		i+=1
	else:
		i+=1
print(j)
def main():
    n = int(input())
    inlis = []
    namelis = []
    for i in range(n):
        a, b = map(str, input().split())
        b = int(b)
        inlis.append([a,b])
        namelis.append(a)
    namelis.sort()    
    inlis_so = sorted(inlis)
    anslis = []
    for num in inlis:
        #print(num, num[0], inlis_so, inlis_so.count(num[0]))
        kazu = namelis.count(num[0])
        if kazu == 1:
            anslis.append(inlis_so.index(num))
        else:
            kijun = namelis.index(num[0])+1
            kouho = list(filter(lambda word:True if word[0] == num[0] else False,inlis))
            kouho_so = sorted(kouho, key = lambda x:x[1], reverse = True)
            suujibun = kouho_so.index(num)
            anslis.append(kijun + suujibun)
    for i in range(1, n):
        print(anslis.index(i)+1)

    

        
    
if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    n = int(input())
    inlis = []
    namelis = []
    for i in range(n):
        a, b = map(str, input().split())
        b = int(b)
        inlis.append([a,b])
        namelis.append(a)
    namelis.sort()    
    inlis_so = sorted(inlis)
    anslis = []
    for num in inlis:
        #print(num, num[0], inlis_so, inlis_so.count(num[0]))
        kazu = namelis.count(num[0])
        if kazu == 1:
            anslis.append(inlis_so.index(num)+1)
        else:
            kijun = namelis.index(num[0]) + 1
            kouho = list(filter(lambda word:True if word[0] == num[0] else False,inlis))
            kouho_so = sorted(kouho, key = lambda x:x[1], reverse = True)
            suujibun = kouho_so.index(num)
            anslis.append(kijun + suujibun)
    for i in range(1, n+1):
        #print(anslis)
        print(anslis.index(i)+1)

    

        
    
if __name__ == "__main__":
    main()
A,B,C,D = map(int,input().split())


for c in range(101):
    if c % 2 ==0:
        C = C-B
        if C <=0:
            ans = 'Yes'
            break
    else:
        A =A-D
        if A <=0:
            ans = 'No'
            break
#     print(A,B,C,D)
print(ans)

            


### FIXED CODE ###

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


for c in range(205):
    if c % 2 ==0:
        C = C-B
        if C <=0:
            ans = 'Yes'
            break
    else:
        A =A-D
        if A <=0:
            ans = 'No'
            break
#     print(A,B,C,D)
print(ans)
h=int(input())
w=int(input())
n=int(input())
s=[[h*w for i in range(h)] for j in range(w)]
li=[]
for i in range(w):
  for j in range(h):
    s[i][j]=w*i+h*j-i*j
    if s[i][j]>=n:
      li.append(i+j)
print(min(li))

### FIXED CODE ###

h=int(input())
w=int(input())
n=int(input())

m=max(h,w)
if n%m==0:
  print(int(n/m))
else:
  print(int(n/m+1))
N, M, K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
Asum = []
Bsum = []
a = 0
b = 0
for i in range(N):
    a += A[i]
    if a > K:
        break
    Asum.append(a)
for i in range(M):
    b += B[i]
    if b > K:
        break
    Bsum.append(b)
Asum.append(0)
Bsum.append(0)
res = 0
for i in range(-1,N):
    if Asum[i] > K:
        break
    for j in range(-1,M):
        if Asum[i] + Bsum[j] > K:
           break
        else:
           res = max(res,(i+j+2))
print(res)

### FIXED CODE ###

N, M, K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
Asum = [0]
Bsum = [0]
a = 0
b = 0
for i in range(N):
    a += A[i]
    Asum.append(a)
for i in range(M):
    b += B[i]
    Bsum.append(b)
Asum.append(0)
Bsum.append(0)
res, j = 0, M
for i in range(N+1):
    if Asum[i] > K:
        break
    while Asum[i] + Bsum[j] > K:
            j -= 1
    res = max(res,i+j)
print(res)
import functools


def divise(n, divisor):
    if n == divisor:
        return n
    elif (n % divisor) == 0:
        return 0
    else:
        return n

number = int(input())
origin = [int(input()) for _ in range(number)]

divised = origin

for i in range(2, max(origin)+1):
    divised = list(map(functools.partial(divise, divisor=i), divised))

for j in range(number):
    if divised[j] == 0:
        origin.pop(j)

print(len(origin))

### FIXED CODE ###

def is_prime(n):
    i = 2
    while i * i <= n:
        if n % i == 0:
            return False
        i += 1
    return True

count = 0

number = int(input())
for i in range(number):
    n = int(input())
    if is_prime(n):
        count = count + 1

print(count)
n=int(input())
a=list(map(int,input().split()))
A=list(set(a))
ans="Yes"
if len(A)!=3 or A==[0]:
    ans="No"
    if a.count(A[0])==2*a.count(A[1]) or 2*a.count(A[0])==a.count(A[1]):
        ans="Yes"
print(ans)

### FIXED CODE ###

n=int(input())
L=list(map(int,input().split()))
LL=list(set(L))
ans="No"
if LL==[0]:
    ans="Yes"
elif len(LL)==2:
    if L.count(LL[0])==2*L.count(LL[1]) or L.count(LL[1])==2*L.count(LL[0]):
        ans="Yes"
elif len(LL)==3:
    if L.count(LL[0])==L.count(LL[1]) and L.count(LL[1])==L.count(LL[2]):
        if LL[0]^LL[1]^LL[2]==0:
            ans="Yes"
print(ans)
number = "".join(input())
if int(number) % 4 == 0:
  print("YES")
else:
  print("NO")



### FIXED CODE ###

number = list(map(str, input().split(" ")))
N = "".join(number)
if int(N) % 4 == 0:
  print("YES")
else:
  print("NO")
def inp():
    return(int(input()))
  
i = inp()
D = inp[0]
T = inp[1]
S = inp[2]

if D/T > S:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) ]))
def invr():
    return(map(int,input().split()))
  
i = inlt()
D = i[0]
T = i[1]
S = i[2]
 
if D/T > S:
  print("No")
else:
  print("Yes")
def m(L,R):
 T=[]
 for l in L[::-1]:
  while R and R[-1]>l:T+=[R.pop()]
  T+=[l]
 return R+T[::-1]
def d(A):
 l=len(A);global c;c+=l
 s=l//2;return m(d(A[:s]),d(A[s:]))if l>1 else A
def s():
 c=-int(input())
 print(*d(list(map(int,input().split()))))
 print(c)
if'__main__'==__name__:s()


### FIXED CODE ###

def m(L,R):
 T=[]
 for l in L[::-1]:
  while R and R[-1]>l:T+=[R.pop()]
  T+=[l]
 return R+T[::-1]
def d(A):
 l=len(A);global c;c+=l
 s=l//2;return m(d(A[:s]),d(A[s:]))if l>1 else A
if'__main__'==__name__:
 c=-int(input())
 print(*d(list(map(int,input().split()))))
 print(c)