Harryxun/stf_run huggingface dataset:
N = 10**6

N1 = [i for i in range(N+40)]
N2 = [i for i in range(N+40)]

#N1[0] = 0
#N2[0] = 0

p = [n*(n+1)*(n+2)//6 for n in range(1,200) if n *(n+1)*(n+2)//6< N+1]
p2 = [n*(n+1)*(n+2)//6 for n in range(1,200) if n *(n+1)*(n+2)//6< N+1 and n *(n+1)*(n+2)//6 % 2 ==1 ]
#print(p2)
for p_ in p:
    if p_ > N +1:
        continue
    n = min(p_*5,N)
    for j in range(p_,n):
#        print(j)
        if N1[j] > N1[j-p_] +1:
            N1[j] = N1[j-p_]+1
for p_ in p2:
    if p_ > N +1 :
        continue
    n = min(p_*7,N+1)
    for j in range(p_,n):
        if N2[j] > N2[j-p_]+1:
            N2[j] = N2[j -p_]+1
#print('a')
while True:
    n = int(input())
    if n == 0:
        break
    print(N1[n],N2[n])



### FIXED CODE ###

import copy

item = [i *(i +1) * (i+2) //6 for i in range(1,181)]
q = []
while True:
    in_ = int(input())
    if in_ == 0:
        break
    q.append(in_)

INIT = 1000
MAX = max(q) +10
ans = [INIT] *MAX
ans[0] = 0
odd_item = [i for i in item if i % 2 ==0 ]
even_item = [i for i in item if not(i % 2 == 0)]

for i in even_item:
    for j in range(0,MAX-i):
        if ans[j+i] > ans[j] + 1:
            ans[j+i] = ans[j] + 1

ans_ = copy.deepcopy(ans)

for i in odd_item:
    for j in range(0,MAX-i):
        if ans[j+i] > ans[j] + 1:
            ans[j+i] = ans[j]+1
for i in q:
    print(ans[i],ans_[i])
import numpy as np
import itertools
def p(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
n=int(input())
p=p(n)
if len(p)==1:
    print(p[0]-1)
    exit()
a=10**12
b=1
for i in p:
    b*=i
pp=int(len(p)**0.5) 
for k in range(pp,min(,len(p)pp+5)):    
    for i in itertools.combinations(p, k):
        c=np.prod(i)
        a=min(a,c+b//c)
print(a-2)

### FIXED CODE ###

n=int(input())
a=10**12
for i in range(1,int(n**0.5)+2):
    if n%i==0:
        a=min(a,i+n//i-2)
print(a)
s=int(input())
c=abs(753-(s[0]+s[1]+s[2]))

for i in range(1,len(n)-2):
  sum=s[i]+s[i+1]+s[i+2]
  d=abs(753-sum)
  e=min(c,d)
  
print(e)

### FIXED CODE ###

s = input()
m = []
for i in range(len(s)-2):
	m.append(abs(753-int(s[i:i+3])))
print(min(m))
x = input().split()

print(min(x[0], x[1])+min(x[2],x[3]))

### FIXED CODE ###

x = []
count = 0

while count<4:
  n = input()
  x.append(n)
  count = count + 1

out = min(int(x[0]),int(x[1]))+min(int(x[2]),int(x[3]))

print(out)
import bisect
N, M = map(int, input().split())
a = []
number = []
flag = 0
for i in range(M):
    A, B = map(int, input().split())
    a.append([A, B])
    a.append([B, A])
    number.append(A)
    number.append(B)
a.sort()
b = a[:]
b.reverse()
one = []
two = []
for i in range(M):
    if a[i][0] == 1:
        one.append(a[i][1])
    else:
        break

for i in range(M):
    if b[i][0] == N:
        two.append(b[i][1])
    else:
        

###
#for i in range(len(one)):
#    for j in range(len(two)):
#        if one[i] == two[j]:
#            flag = 1
#            print("POSSIBLE")
#            break
#    if flag == 1:
#        break
###
if flag == 0:
    print("IMPOSSIBLE")


### FIXED CODE ###

import sys

N, M = map(int, input().split())
ship = [[] for i in range(N+1)]

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

flag = 0
for i in ship[1]:
    if N in ship[i]:
        flag = 1
if flag == 1:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
N = int(input())
en = [[] for _ in range(N)]
on = [[] for _ in range(N)]
for i in range(N - 1):
    u, v, w = map(int, input().split())
    if w % 2:
        on[u - 1].append(v - 1)
        on[v - 1].append(u - 1)
    else:
        en[u - 1].append(v - 1)
        en[v - 1].append(u - 1)

color = [None] * N


def dfs(node, parent, col):
    if color[node] is not None:
        return
    color[node] = col
    for k in en[node]:
        if k != parent:
            dfs(k, node, col)
    for k in on[node]:
        if k != parent:
            dfs(k, node, (col + 1) % 2)


dfs(0, -1, 0)
print(*color, sep="\n")


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline

N = int(input())
en = [[] for _ in range(N)]
on = [[] for _ in range(N)]
for i in range(N - 1):
    u, v, w = map(int, input().split())
    if w % 2:
        on[u - 1].append(v - 1)
        on[v - 1].append(u - 1)
    else:
        en[u - 1].append(v - 1)
        en[v - 1].append(u - 1)

color = [None] * N


def dfs(node, parent, col):
    if color[node] is not None:
        return
    color[node] = col
    for k in en[node]:
        if k != parent:
            dfs(k, node, col)
    for k in on[node]:
        if k != parent:
            dfs(k, node, (col + 1) % 2)


dfs(0, -1, 0)
print(*color, sep="\n")
import sys
import math
import itertools
import collections
import numpy as np

rl = sys.stdin.readline

def a():
    N, M = map(int, rl().split())
    li = [[] for _ in range(N)]
    deg = [0] * N
    for _ in range(M):
        a, b = map(int, rl().split())
        a -= 1
        b -= 1
        li[a].append(b)
        deg[b] = 1
    deg = collections.deque([i for i in range(N) if deg[i] == 0])
    dp = [0] * N
    while deg:
        i = deg.popleft()
        for j in li[i]:
            dpj = dp[j]
            dpi = dp[i]
            if dpj < dpi + 1:
                dp[j] = dpi + 1
            deg.appendleft(j)
    print(max(dp))
a()




        




### FIXED CODE ###

import sys
import math
import itertools
import collections
import numpy as np

rl = sys.stdin.readline

def a():
    N, M = map(int, rl().split())
    li = [[] for _ in range(N)]
    deg = [0] * N
    for _ in range(M):
        a, b = map(int, rl().split())
        a -= 1
        b -= 1
        li[a].append(b)
        deg[b] += 1
    d = collections.deque([i for i in range(N) if deg[i] == 0])
    dp = [0] * N
    while d:
        i = d.popleft()
        for j in li[i]:
            deg[j] -= 1
            if deg[j] == 0:
                dp[j] = max(dp[j] ,dp[i] + 1)
                d.append(j)
    print(max(dp))
a()
import collections

s = input()
c = collections.Counter(s).most_common()
m = c[0][1]
maxi = 0
if m == 1:
    print(len(s) // 2)
else:
    for k in c:
        if k[1] == m and k[0] != s[0]:
            index = [i for i, x in enumerate(s) if x == k[0]]
            sa = [index[i + 1] - index[i] for i in range(m - 1)]
            if maxi < min(sa):
                use = k
                maxi = min(sa)
    ans = 0
    while len(set(s)) != 1:
        a = ""
        for i in range(len(s) - 1):
            if s[i] == use[0] or s[i + 1] == use[0]:
                a += use[0]
            else:
                a += s[i]
        ans += 1
        s = a
    print(ans)

### FIXED CODE ###

s_ = input()
answ = float("inf")
for i in s_:
    s = s_
    ans = 0
    while len(set(s)) != 1:
        a = ""
        for j in range(len(s) - 1):
            if s[j] == i or s[j + 1] == i:
                a += i
            else:
                a += s[j]
        ans += 1
        s = a
    answ = min(answ, ans)
print(answ)
h,w=map(int, input().split())
s=[' '*(w+2)]
for _ in range(h):
    s.append(' '+input()+' ')
s.append(' '*(w+2))

#print(s)

for i in range(1,w+1):
    for j in range(1,h+1):
        if s[i][j]=='#':
            if s[i-1][j]!='#' and s[i+1][j]!='#' and s[i][j-1]!='#' and s[i][j+1]!='#' :
                    print('No')
                    exit()
print('Yes')


### FIXED CODE ###

h,w=map(int, input().split())
s=[' '*(w+2)]
for _ in range(h):
    s.append(' '+input()+' ')
s.append(' '*(w+2))

for i in range(1,w+1):
    for j in range(1,h+1):
        if s[j][i]=='#':
            if s[j-1][i]!='#' and s[j+1][i]!='#' and s[j][i-1]!='#' and s[j][i+1]!='#' :
                    print('No')
                    exit()
print('Yes')
x=raw_input().split()

x(reversed(range(len(x))))

### FIXED CODE ###

n = int(raw_input())
a = map(int,raw_input().split())
a.reverse()
for i in a:
    print i,
s=list(input())
divide=["dream","erase","eraser","dreamer"]
#全探索する
def dfs(n):
        if n==len(s):#最後まで行ったらtrue
                return True
        for i in divide:
                if n+len(i)<=len(s) and "".join(s[n:n+len(i)])==i:
                        if dfs(n+len(i)):
                                print(n)
                                return True
        return False
print("YES") if dfs(0) else print("NO")


### FIXED CODE ###

s=input().replace("eraser",",").replace("erase",",").replace("dreamer",",").replace("dream",",").replace(",","")
print("YES" if s=="" else "NO")
strings,num = map(int,input().split())
result = ""
str_array = []

for i in range (strings):
    str_array.append(input())

str_array.sort()

for i in range (num):
    result += str_array[i]

print(result)

### FIXED CODE ###

num,strings = map(int,input().split())
result = ""
str_array = []

for i in range (num):
    str_array.append(input())

str_array.sort()

for x in range (num):
    result = result + str_array[x]

print(result)
while True:
    a = list(map(int, input().split()))
    b = a[0]
    c = a[1]
    if b == c == 0:
        break
    for i in range(1,b+1):
        if i % 2 != 0:
            if c % 2 == 0:
                print('#.' * (c / 2))
            else:
                print('#.' * ((c -1) /2) + '#')
        else:
            if c % 2 == 0:
                print('.#' * (c / 2))
            else:
                print('.#' * ((c -1) /2) + '.')
    print()

### FIXED CODE ###

while True:
    a = list(map(int, input().split()))
    b = a[0]
    c = a[1]
    if b == c == 0:
        break
    for i in range(1, b+1):
        if i % 2 != 0:
            if c % 2 == 0:
                print('#.' * (c // 2))
            else:
                print('#.' * (c // 2) + '#')
        else:
            if c % 2 == 0:
                print('.#' * (c // 2))
            else:
                print('.#' * (c // 2) + '.')
    print()
import math

r=int(input().strip())
print('{0:5f} {1:5f}'.format(r**2*math.pi,2*r*math.pi))


### FIXED CODE ###

import math

r=float(input().strip())
print('{0:5f} {1:5f}'.format(r**2*math.pi,2*r*math.pi))
N,M = map(int,input().split())
hint_list = [list(map(int,input().split())) for i in range(M)]
friend_list = []

def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]

hint_list = get_unique_list(hint_list)

if M == 0:
    print(N)
else:
    friend_list.append(hint_list[0])
    for i in range(1,len(hint_list)):
        for j in range(len(friend_list)):
            if hint_list[i][0] in friend_list[j]:
                if hint_list[i][1] in friend_list[j]:
                    pass
                else:
                    frined_list[j].append(hint_list[i][1])
            elif hint_list[i][1] in friend_list[j]:
                if hint_list[i][0] in friend_list[j]:
                    pass
                else:
                    frined_list[j].append(hint_list[i][0])
            else:
                pass

    friend_length = []

    for i in range(len(friend_list)):
        friend_length.append(len(friend_list[i]))

print(max(friend_length))

### FIXED CODE ###

from collections import deque
 
N,M = map(int,input().split())
hint_list = [list(map(int,input().split())) for i in range(M)]

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x -= 1
        y -= 1
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

uf = UnionFind(N)
for i in range(len(hint_list)):
    uf.union(hint_list[i][0],hint_list[i][1])
    
print(-min(uf.parents))
N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >= M:
	print(0)
else:
	X.sort()
	x = 0
	y = [0] * (N - 1)
	for i in range(M - 1):
		a = X[i+1] - X[i]
		b = min(y)
		if a > b:
			y.remove(b)
			y.append(a)
			x += b
		else:
			x += a
	print(x)

### FIXED CODE ###

N, M = map(int, input().split())
X = list(map(int, input().split()))
if N >= M:
	print(0)
else:
	X.sort()
	Y = [0] * (M - 1)
	for i in range(M - 1):
		Y[i] = X[i+1] - X[i]
	Y.sort(reverse = True)
	print(max(X) - min(X) - sum(Y[:N - 1]))
import math
n = int(input())
i = 0
ans = 10**13
for i in range(int(math.sqrt(n))):
    if n%i != 0:
        continue
    j = n // i
    ans = min(ans, i+j-2)
print(ans)


### FIXED CODE ###

import math
n = int(input())
ans = 0
for i in reversed(range(int(math.sqrt(n))+1)):
    if n%i == 0:
        j = n // i
        ans = i+j-2
        break
print(ans)
import numpy as np

N, M = map(int, input().split())
H = list(map(int, input().split()))
H.insert(0, 0)

A = np.zeros(M, dtype=int)
B = np.zeros(M, dtype=int)

for i in range(M):
    A[i], B[i] = map(int, input().split())
print(A, B)

ans = 0
for j in range(1, N+1):
    ind = np.concatenate([[0], A[B==j], B[A==j]])
#    print(j, ind)
    if H[j] > max(list(map(lambda x: H[x], ind))):
        ans += 1
print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
H = list(map(int, input().split()))
MaxHeight = [0]*n
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    MaxHeight[a] = max(MaxHeight[a], H[b])
    MaxHeight[b] = max(MaxHeight[b], H[a])
ans = 0
for h, mh in zip(H, MaxHeight):
    ans = ans + 1 if h > mh else ans
print(ans)
Q = int(input())

M = 10**5+5
primes = [True] * M
primes[0] = False
primes[1] = False


for i in range(2, M):
    if primes[i]:
        for j in range(2, M//i+1):
            primes[i*j] = False

print(primes)
cnt = [0] * M

for i in range(3, M):
    cnt[i] = cnt[i-1]
    if primes[i] and primes[(i+1)//2]:
        cnt[i] += 1
print(cnt)
queues = []
for q in range(Q):
    l, r = map(int, input().split())
    queues.append((l, r))

for l, r in queues:
    print(cnt[r] - cnt[l-1])


### FIXED CODE ###

Q = int(input())

M = 10**5+5
primes = [True] * M
primes[0] = False
primes[1] = False


for i in range(2, M):
    if primes[i]:
        for j in range(2, (M-1)//i+1):
            primes[i*j] = False

# print(primes)                                                                    
cnt = [0] * M

for i in range(3, M):
    cnt[i] = cnt[i-1]
    if primes[i] and primes[(i+1)//2]:
        cnt[i] += 1
# print(cnt)                                                                       
queues = []
for q in range(Q):
    l, r = map(int, input().split())
    queues.append((l, r))

for l, r in queues:
    print(cnt[r] - cnt[l-1])
a=int,input()
print(a^3)

### FIXED CODE ###

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

abcd = [list(map(int, input().split())) for _ in range(q)]
from itertools import combinations_with_replacement as cwr
A = list(cwr(range(1, m+1), n))


maxPoint = 0
for item in A:
  point = 0
  for i in range(len(abcd)):
    a = abcd[i][0]
    b = abcd[i][1]
    c = abcd[i][2]
    d = abcd[i][3]
    if item[b-1] - item[a-1] == item[c-1]:
      point += d
  if point > maxPoint:
    maxPoint = point
print(maxPoint)

### FIXED CODE ###

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

abcd = [list(map(int, input().split())) for _ in range(q)]
from itertools import combinations_with_replacement as cwr
AList = list(cwr(range(1, m+1), n))


maxPoint = 0
for A in AList:
  point = 0
  for abc in abcd:
    a = abc[0]
    b = abc[1]
    c = abc[2]
    d = abc[3]
    if A[b-1] - A[a-1] == c:
      point += d
  if point > maxPoint:
    maxPoint = point
print(maxPoint)
#変数に注意。。。#
def f(n,l):
  m=A[n]
  if m==1:
    print(l)
  elif L[m]==1:
    print(-1)
  else:
    L[m]=1
    return f(m,l+1)

N=int(input())
L=[0 for i in range(N)]
A=[int(input())-1  for _ in range(N)]
L[0]=1
f(0,1)

### FIXED CODE ###

N=int(input())
L=[0 for i in range(N)]
A=[int(input())-1  for _ in range(N)]
n=0
m=1
while L[n]!=1 and A[n]!=1:
  L[n]=1
  m+=1
  n=A[n]
if L[n]==1:
  print(-1)
else:
  print(m)
#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=1
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
s=str(input())
if(len(s)==2):
    print(s)
else:
    print(s[::-1])
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()

### FIXED CODE ###

#JMD
#Nagendra Jha-4096

 
import sys
import math

#import fractions
#import numpy
 
###File Operations###
fileoperation=0
if(fileoperation):
    orig_stdout = sys.stdout
    orig_stdin = sys.stdin
    inputfile = open('W:/Competitive Programming/input.txt', 'r')
    outputfile = open('W:/Competitive Programming/output.txt', 'w')
    sys.stdin = inputfile
    sys.stdout = outputfile

###Defines...###
mod=1000000007
 
###FUF's...###
def nospace(l):
    ans=''.join(str(i) for i in l)
    return ans
 
 
 
##### Main ####
s=str(input())
if(len(s)==2):
    print(s)
else:
    print(s[::-1])
    
    
#####File Operations#####
if(fileoperation):
    sys.stdout = orig_stdout
    sys.stdin = orig_stdin
    inputfile.close()
    outputfile.close()
n = int(input())
m = map(int, input().split())
flag = "APPROVED"

for i in m:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
    		flag = "DENIED"
    
print(flag)


### FIXED CODE ###

n = int(input())
m = map(int, input().split())
flag = "APPROVED"

for i in m:
	if i % 2 == 0:
		if i % 3 != 0 and i % 5 != 0:
			flag = "DENIED"
    
print(flag)
a=input()
a=int(a)
b=input()
b=int(b)
c=input()
c=int(c)
if(a==5 and b==7 and c==5):
    print("YES")
elif(a==5 and b==5 and c==7):
    print("YES")
elif(a==7 and b==5 and c==5):
    print("YES")
else:
    print("NO")
   

### FIXED CODE ###

a, b,c = map(int,input().split())
if(a==5 and b==7 and c==5):
    print("YES")
elif(a==5 and b==5 and c==7):
    print("YES")
elif(a==7 and b==5 and c==5):
    print("YES")
else:
    print("NO")
X = raw_input()
print X*X*X

### FIXED CODE ###

x = raw_input()
Y = int(x)
Y = Y*Y*Y
print Y
from sympy import nextprime
import sympy
import isprime

X = int(input())

if isprime(X) = "True":
    print(X)

else:
    p = sympy.nextprime(X, 1)
    print(p)

### FIXED CODE ###

N = int(input())

def prime_check(num):
    for i in range(2, num):
        if num % i == 0:
            return False
    return True

for x in range(N, 1000000):
    if prime_check(x):
        print(x)
        exit()
n=int(input())
a=list(list(map(int,input().split())))
ma=max(a)
l,r=[0]*(ma+n+1),[0]*(ma+n+1)
for i,a in enumerate(a):
    l[i+a]+=1
    if i-a<0:
        continue
    else:
        r[i-a]+=1
ans=0
for a,b in zip(l,r):
    ans+=a*b
print(ans)

### FIXED CODE ###

from collections import Counter
n=int(input())
a=list(list(map(int,input().split())))
ma=[i-a[i] for i in range(n)]
r=Counter(ma)
ans=0
for i in range(n):
    ans+=r[i+a[i]]
print(ans)
while raw_input() != 0
	print 'Case i: ',raw_input()

### FIXED CODE ###

a = int(1)
b = int(1)
while True:
	b = int(raw_input())
	if b != 0:
		print('Case ' + str(a) + ': ' + str(b))
		a += 1
		continue
	else:
		break
import itertools

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

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

saisyo = float("inf")
for i in intertools.product(range(2), N):
    a = [0]*M
    gokei = 0
    for j in range(N):
        if i[j] == 1:
            gokei += A[j][0]
            for k in range(1, M+1):
                a[k-1] += A[j][k]
    if min(a) >= X:
        saisyo = min(saisyo, gokei)

print(saisyo if saisyo != float("inf") else -1)

### FIXED CODE ###

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

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

saisyo = float("inf")
for i in range(2**N):
    a = [0]*M
    gokei = 0
    for j in range(N):
        if (i>>j)&1:
            gokei += A[j][0]
            for k in range(1, M+1):
                a[k-1] += A[j][k]
    if all(a[l] >= X for l in range(M)):
        saisyo = min(saisyo, gokei)

print(saisyo if saisyo != float("inf") else -1)
n = int(input())
info = list(map(int, input().split()))

for i in n:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            if i == n:
                print("APPROVED")
            else:
                continue
        else:
            print("DENIED")
            break

### FIXED CODE ###

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

for i in range(n + 1):
    if i == n:
        print("APPROVED")
    else:
        if info[i] % 2 == 0:
            if info[i] % 3 == 0 or info[i] % 5 == 0:
                continue
            else:
                print("DENIED")
                break
N=int(input())
l=[]
c=0

for i in range(N):
  a = int(input())
  l.append(a)

for j in range(N):
  for k in range(j+1,N):
    for m in range(k+1,N):
      if (l[j]==l[k] or l[k]==l[m] or l[j]==l[m]):
        continue
      if ((l[j] + l[k] > l[m]) and (l[k] + l[m] > l[j]) and (l[j] + l[m] > l[k])):
        c += 1

print(c)


### FIXED CODE ###

N = int(input())
L = list(map(int, input().split()))
c = 0
 
for i in range(N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      if L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i]:
        if L[i] + L[j] + L[k] > 2 * max(L[i],L[j],L[k]):
          c +=1
 
print(c)
import numpy as np
N, M, K = map(int, input().split())
A = [0] + list(map(int, input().split()))
B = [0] + list(map(int, input().split()))

csA = np.cumsum(A)
csB = np.cumsum(B)

if csA[-1] + csB[-1] <= K:
    print(N+M)

else:
    
    ans = 0
               
    for i in range(N+1):
        wa = csA[i]
        numA = i
        if wa <= K:
            for j in range(M+1):
                numB = j
                wa += csB[j]
                if wa > K:
                    if numA + numB - 1 > ans:
                        ans = numA + numB - 1
                    break
                else:
                    wa = csA[i]
        else:
            break

    print(ans)

### FIXED CODE ###

import numpy as np
N, M, K = map(int, input().split())
A = np.cumsum([0] + list(map(int, input().split())))
B = np.cumsum([0] + list(map(int, input().split())))
ans = 0
j = M
for i in range(N+1):
  if A[i] > K:
    break
  while A[i] + B[j] > K:
    j -= 1
  ans = max(ans,i+j)
print(ans)
a,b=map(int,input())
print(a*b,(a+b)*2)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,(a+b)*2)
def lensetlist(A):
    B = []
    for i in A:
        if i not in B:
            B.append(i)
    return len(B)

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

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

result = []
stack = []
ans = 0
count = 0
def path(start, visited):
    count += 1
    if count > 10000:
        break
    if len(visited) == N:
        result.append(visited[:])
        exit
    stack.append(start)
    while len(stack) > 0:
        nextpoint = stack.pop()
        if nextpoint in visited:
            continue
        visited.append(nextpoint)
        for i in range(2*M):
            if A[i] == start:
                path(B[i], visited)
        visited.pop()

path(1, [])
print(lensetlist(result))


### FIXED CODE ###

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

result = []
stack = []

def path(start, visited):
    if len(visited) >= N:
        result.append(visited[:])
        exit
    stack.append(start)
    if len(stack) > 0:
        nextpoint = stack.pop()
        if nextpoint not in visited:
            visited.append(nextpoint)
            for i in range(M):
                if A[i][0] == start:
                    path(A[i][1], visited)
                if A[i][1] == start:
                    path(A[i][0], visited)
            visited.pop()

path(1, [])
result = list(map(list, set(map(tuple, result))))
print(len(result))