Harryxun/stf_run huggingface dataset:
N,K = map(int,input().split())
P = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = -float('inf')
for i in range(N):
    piece = i+1
    temp = 0
    hoge = []
    key = 0
    for j in range(N):
        piece = P[piece-1]
        temp += C[piece-1]
        hoge.append(temp)
        if j+1 > K:
            key = 1
            break
        if piece == i+1:
            break
    if key == 1:
        ans = max(ans,max(hoge))
    elif hoge[-1]<=0:
        ans = max(ans,max(hoge))
    else:
        d = K//len(hoge)
        r = K%len(hoge)
        peak = max(hoge[-1]*(d-1)+max(hoge[r:]),hoge[-1]*d+max(hoge[:r]))
        ans = max(ans,peak)
print(ans)



### FIXED CODE ###

N,K = map(int,input().split())
P = list(map(int,input().split()))
C = list(map(int,input().split()))

ans = -float('inf')
v = []
for n in range(N):
    loop, score = 0, 0
    t = n
    for i in range(min(N, K)):
        n = P[n]-1
        score += C[n]
        ans = max(ans, score)
        if n == t:
            loop = i+1
            break
    v.append((loop, score))

for n in range(N):
    loop, score = v[n]
    if loop > 0 and score > 0:
        r = (K-1)//loop
        nscore = r*score
        for i in range(K-r*loop):
            n = P[n]-1
            nscore += C[n]
            ans = max(nscore, ans)
print(ans)
N, K = map(int,input().split())
if K == 1 or N == 0 or N == K or N%K==0:
    print(0)
    exit()
elif K == 0 or K > N:
    print(N)
    exit()
elif N == 1 or N == K-1 or K == N-1:
    print(1)
    exit()
elif N > K:
    ans = (N//K) + 1
    res = abs(N - (K*ans))
    print(res)
    exit()

### FIXED CODE ###

x, y, z = map(int, input().split())
print(z,x,y)
N, M = map(int, input().split())
#N = 1
#M = 1
l1 = []
l2 = []
ans = 0
rest = M
for i in range(N):
	l1[i],l2[i]  = map(int, input().split())
	#l1[0],l2[0] = 3,1

while true:
	min_index = l1.index(min(l1))
	ans += (min(l1) * l2[min_index])
	rest -= l2[min_index]
	if rest <= 0:
		break
	l1.pop(min_index)

print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
X = []
for i in range(N):
    X.append(list(map(int, input().split())))
X.sort(key=lambda x: x[0])
i = 0
num = 0
ans = 0
while i <= N - 1:
    num += X[i][1]
    ans += X[i][0] * X[i][1]
    if num > M:
        ans -= X[i][0] * (num - M)
        break
    i += 1
print(ans)
t,a,k = input().split()
while k>0:
  if t>0:
    t-=1
    k-=1
  elif t==0 and a>0:
    a-=1
    k-=1
  else if t==0 and a==0:
    break
print(str(t)+' '+str(a))

### FIXED CODE ###

cookies = [int(x) for x in input().split()]
leftOver = cookies[0] - cookies[2]
takahashi = max(0, leftOver)
print(str(takahashi)+ ' ' + (str(cookies[1]) if takahashi > 0  else str(max(0,cookies[1] - abs(leftOver)))))
A, B, K = list(map(int,input().split()))
L = [str(i) for i in range(100,1,-1) if A%i == 0 and B%i == 0]
if len(L) == 0:
  print(1)
else:
  print(L[K-1])


### FIXED CODE ###

A, B, K = list(map(int,input().split()))
L = [i for i in range(100,0,-1) if A%i == 0 and B%i == 0]
print(L[K-1])
K=input()
S=input()
if len(S) <= K:
  print(S)
else:
  print(S[:K]+"...")

### FIXED CODE ###

K=int(input())
S=input()
if len(S) <= K:
  print(S)
else:
  print(S[:K]+"...")
import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [a, b] = string_to_int(inputs[0])

    ret = 0
    if a > b:
        ret += a
        a -= 1
    else:
        ret += b
        b -= 1
    if a > b:
        ret += a
    else:
        ret += b

    return ret


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(2))
    print(ret)


### FIXED CODE ###

import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [a, b] = string_to_int(inputs[0])

    ret = 0
    if a > b:
        ret += a
        a -= 1
    else:
        ret += b
        b -= 1
    if a > b:
        ret += a
    else:
        ret += b

    return ret


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)
n=int(input())
l=list(map(int,input().split()))
ans=1
mod=10**9+7
me=[0,0,0]
now=3
for x in l:
  if x==0:
    ans*now
    now-=1
    if now<0:
      print(0)
      quit()
    me[-now]=1
  else:
    ans=ans*len([i for i, y in enumerate(me) if y == x])%mod
    me[me.index(x)]+=1
if now==0:
  print(6*ans%mod)
else:
  print(3*ans%mod)

### FIXED CODE ###

n=int(input())
mod=1000000007
l=list(map(int,input().split()))
me=[3]+[0]*2*n
ans=1
for x in l:
  ans=ans*me[x]%mod
  me[x]-=1
  me[x+1]+=1
print(ans)
n,m=map(int,input().split())
a=0
b=float('inf')
for i in range(m):
      c,d=map(int,input().spilt())
      a=max(a,c)
      b=min(b,d)
print(max(0,b-a+1))


### FIXED CODE ###

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

a=0
b= float('inf')
for i in range(m):
      c,d=map(int,input().split())
      a=max(a,c)
      b=min(b,d)

print(max(0,b-a+1))
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(reverse=True)
	return divisors

n = int(input())
a = list(map(int,input().split()))
a.append(0)
a.append(0)
a.sort(reverse=True)
ans1 = 0
ans2 = 0
ans3 = 0

result = make_divisors(a[0] - a[2])
for i in range(len(result)):
	next = 0
	for j in range(n):
		if((j != 1) & (a[j] % result[i] != 0)):
			next = 1
			break
	if(next == 0):
		ans1 = result[i]
		break

result = make_divisors(a[0] - a[1])
for i in range(len(result)):
	next = 0
	for j in range(n):
		if((j != 2) & (a[j] % result[i] != 0)):
			next = 1
			break
	if(next == 0):
		ans2 = result[i]
		break

result = make_divisors(a[1] - a[2])
for i in range(len(result)):
	next = 0
	for j in range(n):
		if((j != 0) & (a[j] % result[i] != 0)):
			next = 1
			break
	if(next == 0):
		ans3 = result[i]
		break
max = ans1
if(ans2 > max):
	max = ans2
if(ans3 > max):
	max = ans3
print(max)


### FIXED CODE ###

A, B, T = map(int, input().split())
tmp = (T+0.5) / A
print(int(tmp)*B)
import numpy as np
import math
n = int(input())
A = np.fromstring(input(),dtype=np.int64,sep=" ")
rng = int(math.log2(np.max(A)))+1
sum = 0
for bit in range(rng):
    c = (A & 1).sum()
    sum += c *(n-c)*(2**bit)
    A = A>>1

print(sum %(10**9+7))


### FIXED CODE ###

import numpy as np
 
 
def solve(string):
    n, *a = map(int, string.split())
    # a = ["{:060b}".format(_a) for _a in a]
    a = np.asarray(a, dtype=np.int64)
    m = 10**9 + 7
    ans = 0
    for i in range(60):
        s = int((a & 1).sum())
        a >>= 1
        # ans += s * (n - s) * pow(2, 59 - i, m)
        ans += s * (n - s) * pow(2, i, m) % m
        ans %= m
    return str(ans)
 
 
if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
import numpy as np

L, R = map(int, input().split())
MOD = 2019

# if L == R:
#     tmp = L % MOD
#     print(tmp*tmp)
# else:
#     a = np.array(range(L, R+1)) % MOD
#     b = np.sort(a,kind='quicksort')
#     print(b[0]*b[1])

minMOD = 2019
# minMOD2 = 2019
#
# for i in range(L, R+1):
#     tmp = i % MOD
#     if tmp == 0:
#         minMOD = 0
#         break
#
#     if tmp < minMOD:
#         minMOD = tmp
#     elif tmp < minMOD2:
#         minMOD2 = tmp

#print((minMOD * minMOD2) % MOD)

for i in range(L, R+1):
    for j in range(i+1, R+1):
        tmp = (i*j)%MOD
        if tmp < minMOD:
            minMOD = tmp
            if(tmp == 0):
                break

print(minMOD)


### FIXED CODE ###

import numpy as np

L, R = map(int, input().split())
MOD = 2019

# if L == R:
#     tmp = L % MOD
#     print(tmp*tmp)
# else:
#     a = np.array(range(L, R+1)) % MOD
#     b = np.sort(a,kind='quicksort')
#     print(b[0]*b[1])

minMOD = 2019
# minMOD2 = 2019
#
# for i in range(L, R+1):
#     tmp = i % MOD
#     if tmp == 0:
#         minMOD = 0
#         break
#
#     if tmp < minMOD:
#         minMOD = tmp
#     elif tmp < minMOD2:
#         minMOD2 = tmp

#print((minMOD * minMOD2) % MOD)

for i in range(L, R+1):
    if(i % MOD) == 0:
        minMOD = 0
        break
    for j in range(i+1, R+1):
        if(j % MOD) == 0:
            minMOD = 0
            break
        tmp = (i*j)%MOD
        if tmp < minMOD:
            minMOD = tmp
            if(tmp == 0):
                break

print(minMOD)
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**5]*n
dp[0]=0
for i in range(2,n):
    for j in range(1,k):
        dp[i+j]=min(dp[i+j],dp[i]+abs(h[i+j]-h[i]))
        print(dp[n-1])


### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**5]*n
dp[0]=0
for i in range(1,n):
    dp[i]=min(dp[j]+abs(h[j]-h[i]) for j in range(max(0,i-k),i))
print(dp[n-1])
s = input()
print(s.[::1])

### FIXED CODE ###

s = input()
print(s[::2])
flag = 0
for i  in a:
    if i in A:
        A[A.index(i)] = "0"
B = []
C = []
D = []
E = []
F = []
for i in range(3):
    B.append(A[4*i])
    C.append(A[2*(i+1)])
    D.append(A[3*i])
    E.append(A[3*i+1])
    F.append(A[3*i+2])
    if "0" in A[i*3:i*3+3]:
        if A[i*3:i*3+3].count("0") == 3:
            flag = 1
if "0" in B:
    if B.count("0") == 3:
        flag = 1
if"0"in C:
    if C.count("0") == 3:
        flag = 1
if"0"in D:
    if D.count("0") == 3:
        flag = 1
if"0"in E:
    if E.count("0") == 3:
        flag = 1
if"0"in F:
    if F.count("0") == 3:
        flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

A = list(map(str, input().split()))
A += list(map(str, input().split()))
A += list(map(str, input().split()))
a = []
N = int(input())
for i in range(N):
    a.append(input())
flag = 0
for i  in a:
    if i in A:
        A[A.index(i)] = "0"
B = []
C = []
D = []
E = []
F = []
for i in range(3):
    B.append(A[4*i])
    C.append(A[2*(i+1)])
    D.append(A[3*i])
    E.append(A[3*i+1])
    F.append(A[3*i+2])
    if "0" in A[i*3:i*3+3]:
        if A[i*3:i*3+3].count("0") == 3:
            flag = 1
if "0" in B:
    if B.count("0") == 3:
        flag = 1
if"0"in C:
    if C.count("0") == 3:
        flag = 1
if"0"in D:
    if D.count("0") == 3:
        flag = 1
if"0"in E:
    if E.count("0") == 3:
        flag = 1
if"0"in F:
    if F.count("0") == 3:
        flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")
#(B)Battle
A,B,C,D=map(int,input().split())
while True:
    C -= B
    if C<=0:
        print('Yes')
        break
    A -= D
    if A<=0:
        print('No')
        break

### FIXED CODE ###

S,W = map(int,input().split())
if S<=W:
    print('unsafe')
elif S>W:
    print('safe')
A,B = int(input())

print(A*B)

### FIXED CODE ###

A,B = input().split()
A = int(A)
B = int(B)
print(A*B)
from collections import deque

h,w=map(int,input().split())
S=[]
pos=[]
for i in range(h):
  l=input()
  L=[]
  for j in range(w):
    if l[j]=='.':
      L.append('.')
      pos.append((i,j))
    else:
      L.append('#')
  S.append(L)
Maze=[[float('inf')]*w for i in range(h)]
def bfs(h,w,S,maze,sy,sx,gy,gx):
    maze=Maze
    maze=[[float('inf')]*w for i in range(h)]
    maze[sy][sx]=0
    que=deque([[sy,sx]])
    while que: #キューの中に入っているということはまだ調べる余地有り
        y,x=que.popleft()
        for (i,j) in [(1,0),(0,1),(-1,0),(0,-1)]:
            nexty,nextx=y+i,x+j
            if 0<=nexty<=h-1 and 0<=nextx<=w-1:
              dist=maze[nexty][nextx]
              if S[nexty][nextx]!='#':
                if dist>maze[y][x]+1: #今の経路から(nexty,nextx)に進む方が距離が短くなるなら
                    maze[nexty][nextx]=maze[y][x]+1
                    que.append([nexty,nextx])

    return maze[gy][gx]
M=0
for (sy,sx) in pos:
  for (gy,gx) in pos:
    if bfs(h,w,S,maze,sy,sx,gy,gx)>M:
      M=bfs(h,w,S,maze,sy,sx,gy,gx)

print(M)     


### FIXED CODE ###

from collections import deque

h,w=map(int,input().split())
S=[]
pos=[]
for i in range(h):
  l=input()
  L=[]
  for j in range(w):
    if l[j]=='.':
      L.append('.')
      pos.append((i,j))
    else:
      L.append('#')
  S.append(L)
Maze=[[float('inf')]*w for i in range(h)]
def bfs(h,w,S,Maze,sy,sx):
    maze=Maze
    maze=[[float('inf')]*w for i in range(h)]
    maze[sy][sx]=0
    que=deque([[sy,sx]])
    while que: #キューの中に入っているということはまだ調べる余地有り
        y,x=que.popleft()
        for (i,j) in [(1,0),(0,1),(-1,0),(0,-1)]:
            nexty,nextx=y+i,x+j
            if 0<=nexty<=h-1 and 0<=nextx<=w-1:
              dist=maze[nexty][nextx]
              if S[nexty][nextx]!='#':
                if dist>maze[y][x]+1: #今の経路から(nexty,nextx)に進む方が距離が短くなるなら
                    maze[nexty][nextx]=maze[y][x]+1
                    que.append([nexty,nextx])
    m=0
    for i in range(h):
      for j in range(w):
        if maze[i][j]!=float('inf'):
          if m<maze[i][j]:
            m=maze[i][j]
            
    return m
        
M=0
for (sy,sx) in pos:
  if bfs(h,w,S,Maze,sy,sx)>M:
    M=bfs(h,w,S,Maze,sy,sx)

print(M)
n=int(input())
s=int(input())
print(s.count("ABC"))

### FIXED CODE ###

n=int(input())
s=input()
print(s.count("ABC"))
N = int(input())
fac = []
for i in range(1, N**(1/2) + 1):
  if (N % i == 0 and N // i <= i):
    print(N // i + i - 2)
    exit()

### FIXED CODE ###

N = int(input())
i = 1
ans = N
while (i ** 2 <= N):
  if (N % i == 0):
    ans = min(ans, N // i + i - 2)
  i += 1

print(ans)
import sys
from collections import Counter, deque, defaultdict
from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
from functools import reduce
from math import ceil, floor, log10, log2, factorial
import math

sys.setrecursionlimit(1000000)

MOD = 10 ** 9 + 7

INF = float('inf')
# N = int(input())
# A = [int(x) for x in input().split()]
# A = [int(input()) for _ in range(N)]
# dp = [[0] * 100 for _ in range(100)]
# dp = defaultdict(lambda: float('inf'))
# print('hoge', file=sys.stderr)

N, M = [int(x) for x in input().split()]

# T = [[0] * N for _ in range(N)]
E = [set() for _ in range(N + 1)]

for i in range(M):
    u, v = [int(x) for x in input().split()]
    E[u].add(v)

S, T = [int(x) for x in input().split()]


def f(startSet, n):
    if n == 0:
        return startSet
    ret = set()
    for s in startSet:
        for t in E[s]:
            ret.add(t)
    return f(ret, n - 1)


# print(f({1}, 3))
# print(f({2}, 3))
# print(f({3}, 3))
# print(f({4}, 3))

E2 = [f({i}, 3) for i in range(N + 1)]

openNodes = {S}
closeedNodes = {}
mi = [INF] * (N + 1)
mi[S] = 0

while len(openNodes) != 0:
    curNode = -1
    curW = INF
    for on in openNodes:
        if mi[on] < curW:
            curNode = on
    openNodes.remove(curNode)

    for nn in E2[curNode]:
        if mi[nn] == INF:
            openNodes.add(nn)
            mi[nn] = mi[on] + 1

print(mi[T] if mi[T] != INF else -1)


### FIXED CODE ###

import sys
from collections import Counter, deque, defaultdict
from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
from functools import reduce
from math import ceil, floor, log10, factorial
import math

sys.setrecursionlimit(1000000)

MOD = 10 ** 9 + 7

INF = float('inf')
# N = int(input())
# A = [int(x) for x in input().split()]
# A = [int(input()) for _ in range(N)]
# dp = [[0] * 100 for _ in range(100)]
# dp = defaultdict(lambda: float('inf'))
# print('hoge', file=sys.stderr)

N, M = [int(x) for x in input().split()]

# E = {set() for _ in range(N + 1)}
E = defaultdict(lambda: set())

for i in range(M):
    u, v = [int(x) for x in input().split()]
    u -= 1
    v -= 1
    E[3 * u].add(3 * v + 1)
    E[3 * u + 1].add(3 * v + 2)
    E[3 * u + 2].add(3 * v)

S, T = [int(x) for x in input().split()]
S = 3 * (S - 1)
T = 3 * (T - 1)


def bfs(e, start, end):
    open = deque([start])
    w = dict()
    w[start] = 0
    while len(open) != 0:
        target = open.popleft()
        for next in E[target]:
            if not next in w:
                open.append(next)
                w[next] = w[target] + 1

    return w[end] // 3 if end in w else -1


print(bfs(E, S, T))
import numpy as np

from functools import reduce

n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
ans = 0

def gcd(a, b):
    # 大きい方を被除数、小さい方を除数とする
    dividend = max(a, b)
    divider = min(a, b)

    if divider == 0:
        return dividend

    # 最大公約数を見つけるまで繰り返す
    while dividend % divider != 0:
        # 除算を行い、その除数を次回の被除数、剰余を次回の除数として処理を繰り返す
        r = dividend % divider
        dividend = divider
        divider = r

    # 一方がもう一方を割り切れた時点で、その除数を最大公約数とみなせる
    return divider


def lcm(a, b):
    return (a * b) // gcd(a, b)

a.sort(reverse=True)
v1, v2 = None, None
L = None

# if len(a) > 1:
#     v1 = a[0]
#     v2 = a[1]
#     L = lcm(v1, v2)
#     # print(L)
# else:
#     L = reduce(lcm, a)

L = reduce(lcm, a)

# print(L)

for i in range(n):
    ans += (L // a[i])
    # ans %= mod

print(ans % mod)

### FIXED CODE ###

from functools import reduce

n = int(input())
a = list(map(int, input().split()))
mod = 10**9+7
ans = 0

def gcd(a, b):
    # 大きい方を被除数、小さい方を除数とする
    dividend = max(a, b)
    divider = min(a, b)

    if divider == 0:
        return dividend

    # 最大公約数を見つけるまで繰り返す
    while dividend % divider != 0:
        # 除算を行い、その除数を次回の被除数、剰余を次回の除数として処理を繰り返す
        r = dividend % divider
        dividend = divider
        divider = r

    # 一方がもう一方を割り切れた時点で、その除数を最大公約数とみなせる
    return divider


def lcm(a, b):
    return (a * b) // gcd(a, b)

def modinv(x):
    return pow(x, mod-2, mod)

b = list(set(a))
# for i in range(n):

# L = reduce(lcm, a)
L = reduce(lcm, b)

# print(L)

for i in range(n):
    # ans += (L // a[i])
    ans += L * modinv(a[i])

print(ans % mod)
def main():
    n = int(input())
    a = list(map(int,input().split()))
    l = [0] * 8
    for v in a :
        l[v//400] += 1
    cnt = 0
    for v in range(len(l)-1):
        if v != 0: cnt+=1

    mx = cnt + l[-1]
    mn = cnt if cnt != 0 else 1 if l[-1] != 0 else 0
    print("{} {}".format(str(mn),str(mx)))

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    _ = int(input())
    a = list(map(int,input().split()))
    l = [0] * 9
    for v in a :
        if v//400 >=8:
            l[-1] +=1
        else:
            l[v//400] += 1
    cnt = 0
    for i in range(len(l)-1):
        if l[i] != 0: cnt+=1

    mx = cnt + l[-1]
    mn = cnt if cnt != 0 else 1 if l[-1] != 0 else 0
    print("{} {}".format(str(mn),str(mx)))

if __name__ == '__main__':
    main()
N, Q = map(int, input().split())
 
g = [[] for _ in range(N+1)]
for _ in range(N-1):
  a,b = map(int, input().split())
  g[a].append(b)
  g[b].append(a)
 
cnt = [0] * (N+1)
for _ in range(Q):
  p,x = map(int, input().split())
  cnt[p] += x

def dfs(v, p, add):
    cnt[v] += add
    for nv in g[v]:
        if nv == p:
            continue
        dfs(nv, v, cnt[v])

dfs(1, 0, 0)

print(' '.join(map(str, cnt[1:])))    


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

N, Q = map(int, input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
 
g = [[] for _ in range(N+1)]
for a,b in AB:
    g[a].append(b)
    g[b].append(a)
 
cnt = [0] * (N+1)
for p,x in PX:
    cnt[p] += x

def dfs(v, p, add):
    cnt[v] += add
    for nv in g[v]:
        if nv == p:
            continue
        dfs(nv, v, cnt[v])

dfs(1, 0, 0)

print(' '.join(map(str, cnt[1:])))
a,b=map(int,input().split())
n=sorted([input() for i in range(a)])
print(*n,sep='')


### FIXED CODE ###

a,b,c=map(int,input().split())
n=[a,b,c]
m=len([i for i in n if i==5])
p=len([i for i in n if i==7])
if m==2 and p==1:
  print('YES')
else:
  print('NO')
N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
sa = [abs(T-0.006*H[i] - A) for i in range(N)]
print(sa.index(min(sa))+1)N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
sa = [abs(T-0.006*H[i] - A) for i in range(N)]
print(sa.index(min(sa))+1)

### FIXED CODE ###

N = int(input())
T, A = map(int,input().split())
H = list(map(int,input().split()))
sa = [abs(T-0.006*H[i] - A) for i in range(N)]
print(sa.index(min(sa))+1)
merge(A, left, mid, right)
  n1 = mid - left
  n2 = right - mid
  L = [0]*(n1+1)
  R = [0]*(n2+1)
  for i in range(n1):
    L[i] = A[left + i]
  for i in range(n2):
    R[i] = A[mid + i]
  L[n1] = float("inf")
  R[n2] = float("inf")
  i = 0
  j = 0
  for k in range(left,right): 
    if L[i] <= R[j]:
      A[k] = L[i]
      i = i + 1
    else:
      A[k] = R[j]
      j = j + 1

mergeSort(A, left, right)
  if left+1 < right
    mid = (left + right)//2;
    mergeSort(A, left, mid)
    mergeSort(A, mid, right)
    merge(A, left, mid, right)
    
### Main Function
n = int(input())
S = list(map(int,input().split()))
c = 0

mergeSort(S, 0, n)

print(S)
print(c)


### FIXED CODE ###

def merge(A,left,mid,right):
    n1=mid-left
    n2=right-mid
    L = A[left:mid]
    R = A[mid:right]
    L.append(float("inf"))
    R.append(float("inf"))
    """
    L=[0]*(n1+1)
    R=[0]*(n2+1)
    for i in range(n1):
        L[i]=A[left+i]
    for i in range(n2):
        R[i]=A[mid+i]
    L[n1]=float("inf")
    R[n2]=float("inf")
    """
    i=0
    j=0
    for k in range(left,right):
        global cnt
        cnt+=1
        if L[i]<=R[j]:
            A[k]=L[i]
            i=i+1
        else:
            A[k]=R[j]
            j=j+1

def mergeSort(A,left,right):
    if left+1<right:
        mid=(left+right)//2
        mergeSort(A,left,mid)
        mergeSort(A,mid,right)
        merge(A,left,mid,right)

n=int(input())
S=list(input().split())
for i in range(n):
    S[i]=int(S[i])
cnt=0
mergeSort(S,0,n)
for i in range(n):
    if i==n-1:
        print(S[i])
    else:
        print(S[i],end=" ")
print(cnt)
N,M=map(int,input().split())
A=[list(map(int,input().split())) for _ in range(M)]
 
ans=[0]
for a in A:
    ans[a[0]-1]+=1
    ans[a[1]-1]+=1
 
for a in ans:
    print(a)

### FIXED CODE ###

a,b,c = map(int,input().split())
print('Yes' if a<=c<=b else 'No')
import numpy as np

N = int(input())

output = np.zeros(N)

for x in range(1,int(np.sqrt(N-2))+1):
    for y in range(1,x+1):
        if x**2 + y**2 + x*y > N:
            break
        for z in range(1,y+1):
            index = x**2 + y**2 + z**2 + x*y + y*z + z*x
            
            if index > N:
                break
            
            dup = len(set([x,y,z]))
            
            if dup == 3:
                output[index-1] += 6
            elif dup == 2:
                output[index-1] += 3
            elif dup == 1:
                output[index-1] += 1
                
for i in range(N):
    print(int(output[i]))

### FIXED CODE ###

import numpy as np
 
N = int(input())
 
output = np.zeros(N)
 
for x in range(1,int(np.sqrt(N))+1):
    for y in range(1,x+1):
        if x**2 + y**2 + x*y > N:
            break
        for z in range(1,y+1):
            index = x**2 + y**2 + z**2 + x*y + y*z + z*x
            
            if index > N:
                break
            
            dup = len(set([x,y,z]))
            
            if dup == 3:
                output[index-1] += 6
            elif dup == 2:
                output[index-1] += 3
            elif dup == 1:
                output[index-1] += 1
                
for i in range(N):
    print(int(output[i]))