Harryxun/stf_run huggingface dataset:
import sys
sys.setrecurtionlimit(10**9)

def dfs(v):
  if len(g[v])==0:
    return 0
  dic={}
  for u in g[v]:
    tmp=dfs(u)
    if tmp not in dic:
      dic[tmp]=1
    else:
      dic[tmp]+=1
  pos=max(dic.keys())
  return pos+dic[pos]

n=int(input())
g=[[] for _ in range(n+1)]
for i in range(n-1):
  v=int(input())
  g[v].append(i+2)
print(dfs(1))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

def dfs(v):
  if len(g[v])==0:
    return 0
  dic={}
  for u in g[v]:
    tmp=dfs(u)
    if tmp not in dic:
      dic[tmp]=1
    else:
      dic[tmp]+=1
  arr=[]
  for pos in dic.keys():
    arr+=[pos]*dic[pos]
  arr=sorted(arr,reverse=True)
  return max([(i+1)+arr[i] for i in range(len(arr))])

n=int(input())
g=[[] for _ in range(n+1)]
for i in range(n-1):
  v=int(input())
  g[v].append(i+2)
print(dfs(1))
a = list(map(str,input()))
if a[0] = a[1] and a[2] = a[3] and a[0] != a[2]:
    print("Yes")
elif a[0] = a[3] and a[1] = a[2] and a[0] != a[1]:
    print("Yes")
elif a[0] = a[2] and a[1] = a[3] and a[0] != a[1]:
    print("Yes")
else:
    print("No")
  
    
    
        
    

### FIXED CODE ###

a = list(map(str,input()))
if a[0] == a[1] and a[2] == a[3] and a[0] != a[2]:
    print("Yes")
elif a[0] == a[3] and a[1] == a[2] and a[0] != a[1]:
    print("Yes")
elif a[0] == a[2] and a[1] == a[3] and a[0] != a[1]:
    print("Yes")
else:
    print("No")
a=input();print('cvoonwseoln a n t'[('a'or'i'or'u'or'e'or'o')in a ::2])a=['a','i','u','e','o'];print('cvoonwseoln a n t'[input() in a::2])

### FIXED CODE ###

a=['a','i','u','e','o'];print('cvoonwseoln a n t'[input() in a::2])
n,k = map(int,input().split())
l = list(map(int,input().split()))
ls = []
for i in range(n-k):
  if k>1:
    if l[i] <0 and l[i+k-1]<=0:
      ls.append(abs(l[i]))
    elif l[i] >=0 and l[i+k-1]>0:
      ls.append(abs(l[i+k-1]))
    elif l[i] <0 and l[i+k-1]>0:
      ls.append(2*min(abs(l[i]),l[i+k-1]) + max(abs(l[i]),l[i+k-1]))
  else:
    ls.append(abs(l[i]))
print(min(ls))

### FIXED CODE ###

n,k = map(int,input().split())
l = list(map(int,input().split()))
ls = []
for i in range(n-k+1):
  a = l[i]
  b = l[i+k-1]
  ls.append(min(abs(a)+abs(a-b), abs(b)+abs(a-b)))
print(min(ls))
n = int(input())
a = list(map(int, input().split()))
for i in a:
    if i%2 == 0:
        if i%3 == 0 or i%5 == 0:
            ans = 'APPROVED'
        else:
            ans = 'DENIED'
            break
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
for i in a:
    if i%2 == 0:
        if i%3 == 0 or i%5 == 0:
            continue
        else:
            print('DENIED')
            exit()
print('APPROVED')
import sys
import math
N,X=map(int,input().split())
x=list(map(int,input().split()))
d=abs(x[0]-X)
for i in range(1,len(x)):
    d=math.gcd(d,abs(x[i]-X))
print(d)

### FIXED CODE ###

import fractions
N,X=map(int,input().split())
x=list(map(int,input().split()))
d=abs(x[0]-X)
if N==1:
    print(d)
    exit()
for i in range(1,len(x)):
    d=fractions.gcd(d,abs(x[i]-X))
print(d)
import fractions

n, k = map(int, input().split())
array = [int(x) for x in input().split()]

res = fractions.gcd(array[0], array[1])


for i in array[2:]:
    res = fractions.gcd(res, i)
print("POSSIBLE" if k%res==0 and max(array) >= k else "IMPOSSIBLE")

### FIXED CODE ###

import fractions
import sys

n, k = map(int, input().split())
array = [int(x) for x in input().split()]

if n == 1:
    print("POSSIBLE" if max(array) == k else "IMPOSSIBLE")
    sys.exit()

res = fractions.gcd(array[0], array[1])

for i in array[2:]:
    res = fractions.gcd(res, i)
print("POSSIBLE" if k%res==0 and max(array) >= k else "IMPOSSIBLE")
N, M = map(int, input().split())
edges = [list(map(int, input().split())) for _ in range(M)]

def bellman_ford():
    d = [None] * (N + 1)
    visited = [False] * (N + 1)
    d[1] = 0
    visited[1] = True
    updated = True
    cnt = 0
    
    while updated and (cnt < N):
        updated = False
        cnt += 1
        for u, v, c in edges:
            if (not visited[v]) or (visited[v] and visited[u] and d[v] < d[u] + c):
                d[v] = d[u] + c
                visited[v] = True
                updated = True
                
    return d, cnt

d, cnt = bellman_ford()
print(d[-1] if cnt < N else 'inf')



### FIXED CODE ###

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

for i in range(M):
    edges[i][2] *= -1

INF = 10 ** 20
d = [INF] * (N + 1)

def bellman_ford():    
    d[1] = 0
    for _ in range(N):
        for u, v, c in edges:
            if (d[u] != INF) and (d[v] > d[u] + c):
                d[v] = d[u] + c

negative = [False] * (N + 1)

def bellman_ford_neg():
    for _ in range(N):
        for u, v, c in edges:
            if (d[u] != INF) and (d[v] > d[u] + c):
                d[v] = d[u] + c
                negative[v] = True
                
            if negative[u]:
                negative[v] = True

bellman_ford()
bellman_ford_neg()

if negative[-1]:
    print('inf')
else:
    print(-d[-1])
import numpy

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

a = numpy.array([int(e) for e in input().split(" ")],dtype=numpy.int64)
changes=[]
for i in range(m):
    changes.append([int(e) for e in input().split(" ")])


a.sort()
#昇順ソート

changes.sort(key=lambda x:(x[1],x[0]),reverse = True)

change_num = 0
for change in changes:
    for i in range(change_num, change[0] + change_num):
        if a[i] < change[1]:
            change_num += 1
            a[i] = change[1]
        else:
            break

print(a.sum())

### FIXED CODE ###

import numpy

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

a = numpy.array([int(e) for e in input().split(" ")],dtype=numpy.int64)
changes=[]
for i in range(m):
    changes.append([int(e) for e in input().split(" ")])


a.sort()
#昇順ソート

changes.sort(key=lambda x:(x[1],x[0]),reverse = True)

change_num = 0
for change in changes:
    for i in range(change_num, min(change[0] + change_num,n)):
        if a[i] < change[1]:
            change_num += 1
            a[i] = change[1]
        else:
            break

print(a.sum())
from collections import deque
H,W = map(int,input().split())
grid = [0] * H
num_black = 0
for i in range(H):
    s = input()
    for j in range(len(s)):
        if s[j] == '#':
            num_black += 1
    grid[i] = list(s)
time_grid = [[-1] * W for _ in range(H)]
time_grid[0][0] = 0
queue = deque()
queue.append([0,0,0])
while queue:
    y,x,t = queue.popleft()
    for next_y, next_x in [[y+1,x],[y,x+1],[y-1,x],[y,x-1]]:
        if 0 <= next_x < W and 0 <= next_y < H and grid[next_y][next_x] == '.':
            queue.append([next_y,next_x,t+1])
            time_grid[next_y][next_x] = t+1
            grid[next_y][next_x] = '#'
if time_grid[H][W] != -1:
    print(H*W-time_grid[-1][-1]-1-num_black)
else:
    print(-1)




### FIXED CODE ###

from collections import deque
H,W = map(int,input().split())
grid = [0] * H
num_black = 0
for i in range(H):
    s = input()
    for j in range(len(s)):
        if s[j] == '#':
            num_black += 1
    grid[i] = list(s)
time_grid = [[-1] * W for _ in range(H)]
time_grid[0][0] = 0
queue = deque()
queue.append([0,0,0])
while queue:
    y,x,t = queue.popleft()
    for next_y, next_x in [[y+1,x],[y,x+1],[y-1,x],[y,x-1]]:
        if 0 <= next_x < W and 0 <= next_y < H and grid[next_y][next_x] == '.':
            queue.append([next_y,next_x,t+1])
            time_grid[next_y][next_x] = t+1
            grid[next_y][next_x] = '#'
if time_grid[H-1][W-1] != -1:
    print(H*W-time_grid[-1][-1]-1-num_black)
else:
    print(-1)
import sys

sys.stdin = open('test.txt')

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

all_sum = sum(li)
x = 0
y = all_sum
ans = 10**18

for i in range(n):
    x += li[i]
    y -= li[i]

    if ans >= abs(x-y):
        ans = abs(x-y)

    if i == n - 2:
        break

print(ans)

### FIXED CODE ###

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

all_sum = sum(li)
x = 0
y = all_sum
ans = 10**18

for i in range(n):
    x += li[i]
    y -= li[i]

    if ans >= abs(x-y):
        ans = abs(x-y)

    if i == n - 2:
        break

print(ans)
import numpy as np
import functools
import math

N, X = map(int, input().split())
x_list = list(map(int, input().split()))

if N == 1:
    print(x_list[0] - X)
    exit()

values = np.sort(np.array(x_list))[1:] - min(x_list)
gcd = functools.reduce(math.gcd, values)
print(gcd)

### FIXED CODE ###

N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
mx=min(x)
x=list(map(lambda t:t-mx,x))
def gcd(a,b):
    while b:
        a,b=b,a%b
    return(a)
a=10**10
for i,j in zip(x,x[1:]):
    a=min(a,gcd(i,j))
print(a)
def main():
    n=int(input())
    ga,sa,ba=map(int,input().split())
    gb,sb,bb=map(int,input().split())
    
    def calc_1(dg,a0,a1):
        return (dg//a0)*a1+dg%a0

    def calc_2(dg,a0,a1,b0,b1):
        x=dg//a0
        visit=set()
        temp=0
        for i in range(x,-1,-1):
            amari=(dg-x*a0)%b0
            #if amari in visit:
            #    break
            temp=max(x*a1+((dg-x*a0)//b0)*b1+amari,temp)
            #visit.add(amari)
        return temp

    #def calc_3(dg,a0,a1,b0,b1,c0,c1):
    #    return max([a1*i+calc_2(dg-a0*i,b0,b1,c0,c1) for i in range(dg//a0,-1,-1)])

    gsb=[[ga,gb],[sa,sb],[ba,bb]]
    gsb.sort(key=lambda x:x[1]/x[0],reverse=True)
    temp=[[i,j] for i,j in gsb if i<j]
    if len(temp)==1:
        n=calc_1(n,temp[0][0],temp[0][1])
    elif len(temp)==2:
        n=calc_2(n,temp[0][0],temp[0][1],temp[1][0],temp[1][1])
    elif len(temp)==3:
        n=calc_3(n,temp[0][0],temp[0][1],temp[1][0],temp[1][1],temp[2][0],temp[2][1])

    gsb=reversed(gsb)
    temp=[[j,i] for i,j in gsb if i>j]
    if len(temp)==1:
        n=calc_1(n,temp[0][0],temp[0][1])
    elif len(temp)==2:
        n=calc_2(n,temp[0][0],temp[0][1],temp[1][0],temp[1][1])
    elif len(temp)==3:
        n=calc_3(n,temp[0][0],temp[0][1],temp[1][0],temp[1][1],temp[2][0],temp[2][1])
    print(n)
main()

### FIXED CODE ###

def main():
    n=int(input())
    ga,sa,ba=map(int,input().split())
    gb,sb,bb=map(int,input().split())
    
    def calc_1(dg,a0,a1):
        return (dg//a0)*a1+dg%a0

    def calc_2(dg,a0,a1,b0,b1):
        x=dg//a0
        visit=set()
        temp=0
        for i in range(x,-1,-1):
            amari=(dg-i*a0)%b0
            if amari in visit:
                break
            temp=max(i*a1+((dg-i*a0)//b0)*b1+amari,temp)
            visit.add(amari)
        return temp

    def calc_3(dg,a0,a1,b0,b1,c0,c1):
        return max([a1*i+calc_2(dg-a0*i,b0,b1,c0,c1) for i in range(dg//a0,-1,-1)])

    gsb=[[ga,gb],[sa,sb],[ba,bb]]
    gsb.sort(key=lambda x:x[1]/x[0],reverse=True)
    temp=[[i,j] for i,j in gsb if i<j]
    if len(temp)==1:
        n=calc_1(n,temp[0][0],temp[0][1])
    elif len(temp)==2:
        n=calc_2(n,temp[0][0],temp[0][1],temp[1][0],temp[1][1])
    elif len(temp)==3:
        n=calc_3(n,temp[0][0],temp[0][1],temp[1][0],temp[1][1],temp[2][0],temp[2][1])

    gsb=reversed(gsb)
    temp=[[j,i] for i,j in gsb if i>j]
    if len(temp)==1:
        n=calc_1(n,temp[0][0],temp[0][1])
    elif len(temp)==2:
        n=calc_2(n,temp[0][0],temp[0][1],temp[1][0],temp[1][1])
    elif len(temp)==3:
        n=calc_3(n,temp[0][0],temp[0][1],temp[1][0],temp[1][1],temp[2][0],temp[2][1])
    print(n)
main()
h, a = int(input())
if (h%a == 0):
  print(h//a)
else:
  print(h//a + 1)

### FIXED CODE ###

h, a = map(int,input().split())
if (h%a == 0):
  print(h//a)
else:
  print(h//a + 1)
import math
theta_S=30*H+(1/10)*M
theta_L=6*M
S_x=A*math.sin(math.radians(theta_S))
S_y=A*math.cos(math.radians(theta_S))
L_x=B*math.sin(math.radians(theta_L))
L_y=B*math.cos(math.radians(theta_L))
distance=((S_x-L_x)**2+(S_y-L_y)**2)**0.5
print(distance)

### FIXED CODE ###

#C
A, B, H, M= map(int,input().split())
import math
theta_S=-(30*H+(1/2)*M)+90
theta_L=-(6*M)+90
S_x=A*math.cos(math.radians(theta_S))
S_y=A*math.sin(math.radians(theta_S))
L_x=B*math.cos(math.radians(theta_L))
L_y=B*math.sin(math.radians(theta_L))
distance=((S_x-L_x)**2+(S_y-L_y)**2)**0.5
print(distance)
print(1) if x == 1 else print(0)

### FIXED CODE ###

x = int(input())
print(1) if x == 0 else print(0)
s = list(input())
t = list(input())
len_t = len(t)

for i in range(len(s) - len(t) + 1):
    tmps = s[i:i + len(t)]
    ok = True
    for j in range(len(tmps)):
        if t[j] == tmps[j] or tmps[j] == '?':
            pass
        else:
            ok = False
            break
    if ok == True:
        for k in range(len(t)):
            s[k+i] = t[k]
        break

if ok == False:
    print("UNRESTORABLE")
else:
    for c in s:
        if c == '?':
            print('a', end="")
        else:
            print(c, end="")
    print()


### FIXED CODE ###

import copy

s = list(input())
t = list(input())
if len(s) < len(t):
    print("UNRESTORABLE")
    exit()

ans_list = []
for i in range(len(s) - len(t) + 1):
    tmps = s[i:i + len(t)]
    ok = True
    for j in range(len(tmps)):
        if t[j] == tmps[j] or tmps[j] == '?':
            pass
        else:
            ok = False
            break
    if ok == True:
        cp_s = copy.deepcopy(s)
        for k in range(len(t)):
            cp_s[k+i] = t[k]
        ans_list.append(cp_s)

if len(ans_list) == 0:
    print("UNRESTORABLE")
else:
    # ?をaに書き換え
    for i in range(len(ans_list)):
        for j in range(len(s)):
            if ans_list[i][j] == '?':
                ans_list[i][j] = 'a'
    ans_list.sort()
    for c in ans_list[0]:
        print(c, end="")
    print()
N,A,B = map(int, input().split())

list_ab = []
list_b = ['b']*A
list_ab.extend(list_b)
list_a = ['a']*B
list_ab.extend(list_a)


count = (N//(A+B)+1)
str = list_ab*count


str = str[:N]
print(str.count('b'))


### FIXED CODE ###

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

count = N//(A+B)
if (N-count*(A+B))>A:
    print(count*A+A)
else:
    print(count*A+(N-count*(A+B)))
i = 0
while True:
    x = raw_input()
    if x == 0:
        break
    i += 1
    print "Case %d: %d" % (i, x)

### FIXED CODE ###

i = 0
while True:
    x = int(raw_input())
    if x == 0:
        break
    i += 1
    print "Case %d: %d" % (i, x)
#入力部
C= 998244353
N,M,K=map(int,input().split())

#定義部
F=[0]*N
G=[0]*N

F[0]=1
for i in range(1,N):
    F[i]=(F[i-1]*i)%C

G[i]=pow(F[-1],C-2,C)

for j in range(N-2,-1,-1):
    G[j]=(G[j+1]*(j+1))%C

def nCr(n,r):
    if r<0 or n<r:
        return 0
    else:
        return (F[n]*G[r]*G[n-r])

#メイン部
S=0
for k in range(0,K+1):
    S=(S+M*pow(M-1,N-k-1,C)*nCr(N-1,k))%C
    
print(S%C)


### FIXED CODE ###

#入力部
C= 998244353
N,M,K=map(int,input().split())

#定義部
U=max(N+1,K)
F=[0]*U
G=[0]*U

F[0]=1
for i in range(1,U):
    F[i]=(F[i-1]*i)%C

G[i]=pow(F[-1],C-2,C)

for j in range(U-2,-1,-1):
    G[j]=(G[j+1]*(j+1))%C

def nCr(n,r):
    if r<0 or n<r:
        return 0
    else:
        return (F[n]*G[r]*G[n-r])

#メイン部
S=0
for k in range(0,K+1):
    S=(S+M*pow(M-1,N-k-1,C)*nCr(N-1,k))%C
    
print(S%C)
import sys
if __name__=="__main__":
    a, b = list(map(int, input().split(" ")))
    if(a == 1):
	a = 14
    if(b == 1):
	b = 14
    if(a > b):
        sys.stdout.write("Alice")
    elif(a == b):
        sys.stdout.write("Draw")
    else:
        sys.stdout.write("Bob")

### FIXED CODE ###

if __name__=="__main__":
    a, b = list(map(int, input().split(" ")))
    if(a==1):
        a = 14
    if(b==1):
        b = 14
    if(a > b):
        print("Alice")
    elif(a == b):
        print("Draw")
    else:
        print("Bob")
N = int(input())
a1 = list(map(int, input().split(' ')))
a2 = list(map(int, input().split(' ')))
count = np.zeros(N)
a = np.array([a1,a2])
for i in range(N):
    count[i] += a.T[i].sum()
    count[i] += a[0][:i-1].sum() if i-1 >=0 else 0
    count[i] += a[1][i:].sum()
print(int(count.max())

### FIXED CODE ###

import numpy as np

N = int(input())
a1 = list(map(int, input().split(' ')))
a2 = list(map(int, input().split(' ')))
count = np.zeros(N)
a = np.array([a1,a2])
for i in range(N):
    count[i] += a.T[i].sum()
    count[i] += a[0][:i].sum()
    count[i] += a[1][i+1:].sum() if i+1 < N else 0
print(int(count.max()))
a,b,c=input().split()
a=int(a)
c=char(c)
b=int(b)
if c=='+' :
    print(a+b)
else
    print(a-b)

### FIXED CODE ###

l=input().split()
a=int(l[0])
x=l[1]
b=int(l[2])
if(x=='+'):
    print(a+b)
else:
    print(a-b)
a, b, c = map(int, input().split())
 
if 4*a*b < (c-a-b)**2 ans c > a+b:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a, b, c = map(int, input().split())
 
if 4*a*b < (c-a-b)**2 and c > a+b:
  print("Yes")
else:
  print("No")
A, B = map(int, input().split())
int s
if A>=B:
    s=A
else:
    s=B
S = 2*s - 1
print(S)

### FIXED CODE ###

A, B = map(int, input().split())
s = 0
if A>=B:
    s=A
    A=A-1
else:
    s=B
    B=B-1
S = s
if A>=B:
    s=A
    A=A-1
else:
    s=B
    B=B-1
S=S+s
print(S)
N = int(input())
A = list(map(int,input().split()))
S = []
T = []
for i in range(1,N+1):
    S.append(i+A[i-1])
    T.append(i-A[i-1])

L = [0]*max(S)
for i in range(N):
    L[S[i]-1]+=1

out = 0
for i in range(N):
    if T[i]>0:
        out += L[T[i]-1]
        if T[i]==S[i]:
            out += -1
print(out)

### FIXED CODE ###

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

L = []
for i in range(N):
    L.append(S[i]-1)

from collections import Counter
M = Counter(L)
out = 0
for i in range(N):
    if (T[i]-1>=0)and(len(L)-1>=T[i]-1):
        out += M[T[i]-1]
        if T[i]==S[i]:
            out += -1
print(out)
list_1 = list(map(int,input().split()))
list_2 = list(map(int,input().split()))
list_3 = list(map(int,input().split()))

#n,m = map(int,raw_input().split())
#list_a = []
#for i in range(M) 
list_a=list_1


for x in list_2:
    list_a.append(x)


for x in list_3:
    list_a.append(x)


N = int(input())
#list_b = [int(x) for x in input().split()]
list_b = list(map(int,input().split()))

list_c = [0,0,0,0,0,0,0,0,0]
for i in range(N):
    for j in range(9):
        if list_a[j] == list_b[i]:
            list_c[j] = 1

flag=0
if list_c[0]==1 and list_c[1]==1 and list_c[2]==1:
    flag=1
if list_c[3]==1 and list_c[4]==1 and list_c[5]==1:
    flag=1
if list_c[6]==1 and list_c[7]==1 and list_c[8]==1:
    flag=1
if list_c[0]==1 and list_c[3]==1 and list_c[6]==1:
    flag=1
if list_c[1]==1 and list_c[4]==1 and list_c[7]==1:
    flag=1
if list_c[2]==1 and list_c[5]==1 and list_c[8]==1:
    flag=1
if list_c[0]==1 and list_c[4]==1 and list_c[8]==1:
    flag=1
if list_c[2]==1 and list_c[4]==1 and list_c[6]==1:
    flag=1
    
if flag == 1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

list_1 = list(map(int,input().split()))
list_2 = list(map(int,input().split()))
list_3 = list(map(int,input().split()))

#n,m = map(int,raw_input().split())
#list_a = []
#for i in range(M) 
list_a=list_1


for x in list_2:
    list_a.append(x)


for x in list_3:
    list_a.append(x)


N = int(input())
#list_b = [int(x) for x in input().split()]
#list_b = list(map(int,input().split()))


list_b=[]
for k in range(N):
    b=int(input())
    list_b.append(b)


list_c = [0,0,0,0,0,0,0,0,0]
for i in range(N):
    for j in range(9):
        if list_a[j] == list_b[i]:
            list_c[j] = 1

flag=0
if list_c[0]==1 and list_c[1]==1 and list_c[2]==1:
    flag=1
if list_c[3]==1 and list_c[4]==1 and list_c[5]==1:
    flag=1
if list_c[6]==1 and list_c[7]==1 and list_c[8]==1:
    flag=1
if list_c[0]==1 and list_c[3]==1 and list_c[6]==1:
    flag=1
if list_c[1]==1 and list_c[4]==1 and list_c[7]==1:
    flag=1
if list_c[2]==1 and list_c[5]==1 and list_c[8]==1:
    flag=1
if list_c[0]==1 and list_c[4]==1 and list_c[8]==1:
    flag=1
if list_c[2]==1 and list_c[4]==1 and list_c[6]==1:
    flag=1
    
if flag == 1:
    print('Yes')
else:
    print('No')
def list_pos(cnt,a,b,ans):
    if ans  >= b :
        return cnt-1
    else :
        cnt += 1
        ans += a[cnt][1]
    return list_pos(cnt,a,b,ans)

N,K = map(int,input().split())
para = [[i for i in map(int,input().split())] for j in range(N)]


p = list_pos(0,para,K,0)
print("{}".format(para[p][0]))

### FIXED CODE ###


def list_pos(cnt,a,b,ans):
    if ans  >= b :
        return cnt-1
    else :

        ans += a[cnt][1]
        cnt += 1
        return list_pos(cnt,a,b,ans)
import sys
sys.setrecursionlimit(100000)
N,K = map(int,input().split())
para = {}
for i in range(N):
    a,b  = map(int,input().split())
    if not a in para.keys():
        para[a] = b
    else : para[a] += b

para = sorted(para.items(),key =lambda x:x[0])

p = list_pos(0,para,K,0)
print("{}".format(para[p][0]))
def main(n, a):
  for x in a:
    if(x == 0):
      print(0)
      return
   
  ans = a[0]
  for i in range(1, n):
    ans = ans * a[i]
    if(ans > 1000000000000000000):
      print(-1)
      return
  print(ans)

if(__name__ == '__main__') {
  n = int(input())
  a = map(int, input().split())
  main(n, a)
  	

### FIXED CODE ###

def main(n, a):
  a = list(a)
  for x in a:
    if(x == 0):
      print(0)
      return
   
  ans = a[0]
  for i in range(1, n):
    ans = ans * a[i]
    if(ans > 1000000000000000000):
      print(-1)
      return
  print(ans)
 
if(__name__ == '__main__'):
  n = int(input())
  a = map(int, input().split())
  main(n, a)
N, M = map(int, input().split())
X = list(map(int, input().split()))

Y = sorted(X)
Y = list(map(lambda x,y:x-y, Y[1:],Y[:-1]))

for i in range(N-1):
	x = max(Y)
	Y.remove(x)

print(sum(Y))


### FIXED CODE ###

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

X.sort()
diffX = list(map(lambda x,y:x-y, X[1:], X[:-1]))
diffX.sort(reverse = True)

if N-1 >= len(diffX):
	print(0)
else:
	print(sum(diffX[N-1:]))
n,m,k=map(int,input().split())
if n%k==0 or m%k==0:
  print("Yes")
  exit()
for i in range(n):
  for j in range(m):
    s=(n*i+m*j-i*j)-i*j
    if s==k:
      print("Yes")
      exit()
print("No")

### FIXED CODE ###

n,m,k=map(int,input().split())
for i in range(n+1):
  for j in range(m+1):
    s=m*i+n*j-2*i*j
    if s==k:
      print("Yes")
      exit()
print("No")
A=int(input)
B=int(input)
print(A*B)

### FIXED CODE ###

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