Harryxun/stf_run huggingface dataset:
import numpy as np
while True:
    N,M=map(int,input().split())
    if N==0 and M==0:
        break
    allCards=[]
    for i in range(N+M):
        allCards.append(int(input()))
                        
    Taro=np.array(allCards[:N])
    Hanako=np.array(allCards[N:])
    Tsum=np.sum(Taro)
    Hsum=np.sum(Hanako)
    diff=Tsum-Hsum
    tempsum=1e8
    Tchange=-1
    Hchange=-1
    for i in range(N):
        for j in range(M):
            tempdiff=(Taro[i]-Hanako[j])*2
            if diff==tempdiff:
                if(tempsum>Taro[i]+Hanako[j]):
                    tempsum=Taro[i]+Hanako[j]
                    Tchange=Taro[i]
                    Hchange=Hanako[j]
    if Tchange==-1:
        print(-1)
    else:
        print(Tchange,Hchange)

### FIXED CODE ###

while True:
    N,M=map(int,input().split())
    if N==0 and M==0:
        break
    allCards=[]
    for i in range(N+M):
        allCards.append(int(input()))
                        
    Taro=allCards[:N]
    Hanako=allCards[N:]
    Tsum=sum(Taro)
    Hsum=sum(Hanako)
    diff=Tsum-Hsum
    tempsum=1e8
    Tchange=-1
    Hchange=-1
    for i in range(N):
        for j in range(M):
            tempdiff=(Taro[i]-Hanako[j])*2
            if diff==tempdiff:
                if(tempsum>Taro[i]+Hanako[j]):
                    tempsum=Taro[i]+Hanako[j]
                    Tchange=Taro[i]
                    Hchange=Hanako[j]
    if Tchange==-1:
        print(-1)
    else:
        print(Tchange,Hchange)
import sys
import numpy as np
input = sys.stdin.buffer.readline

N = int(input())
vws = [tuple(map(int, input().split())) for _ in range(N)]

n = min(2**10, N)

dp = np.zeros((n, 10**5+1), np.int64)
dp[0, vws[0][1]:] = vws[0][0]
for i in range(1, n):
    v, w = vws[i]
    dp[i] = dp[(i-1)//2]
    dp[i, w:] = np.maximum(dp[(i-1)//2, :-w]+v, dp[i, w:])

Q = int(input())
for _ in range(Q):
    V, L = map(int, input().split())
    V -= 1
    if V < n:
        print(dp[V][L])
    else:
        vws_choose = []
        while V >= n:
            vws_choose.append(vws[V])
            V = (V-1) // 2

        bits = np.arange(1 << len(vws_choose))
        values = np.zeros_like(bits, np.int64)
        weights = np.zeros_like(bits, np.int64)
        for i in range(len(vws_choose)):
            indices = np.nonzero(np.bitwise_and(bits, 1<<i))
            values[indices] += vws_choose[i][0]
            weights[indices] += vws_choose[i][1]

        mask = (weights <= L)     
        print(np.amax(dp[V][L - weights[mask]] + values))


### FIXED CODE ###

import sys
import numpy as np
from numba import njit

input = sys.stdin.buffer.readline

N = int(input())
vws = [tuple(map(int, input().split())) for _ in range(N)]

n = min(2**11, N)
vws_arr = np.array(vws, np.int32)

dp = np.zeros((n, 10**5+1), np.int32)
for i in range(n):
    v, w = vws[i]
    dp[i] = dp[(i-1)//2]
    dp[i, w:] = np.maximum(dp[(i-1)//2, :-w]+v, dp[i, w:])


@njit("i4(i4[::1], i4[::1], i4, i4[::1])", cache = True)
def func(vs, ws, L, dp_):
    values = np.zeros(1 << len(vs), np.int32)
    weights = np.zeros(1 << len(vs), np.int32)
    for i in range(len(vs)):
        for bits in range(1 << len(vs)):
            if bits & (1 << i):
                values[bits] += vs[i]
                weights[bits] += ws[i]
    ret = 0
    for v, w in zip(values, weights):
        if w <= L:
            ret = max(dp_[L - w] + v, ret)
    return ret

Q = int(input())
for _ in range(Q):
    V, L = map(int, input().split())
    V -= 1
    if V < n:
        print(dp[V, L])
    else:
        Vs = []
        while V >= n:
            Vs.append(V)
            V = (V-1) // 2
        vs = vws_arr[Vs, 0]
        ws = vws_arr[Vs, 1]
        print(func(vs, ws, L, dp[V]))
n,k = map(int,input().split())
s = str(input())
s = s.lower(k)
print(str(s))

### FIXED CODE ###

n,k = map(int,input().split())
s = str(input())
print(str(s[:k-1]+s[k-1].lower()+s[k:]))
N=int(input())
A=[]
for n in range(N):
	A.append(int(input()))
B=A.copy()
B.sort()
C=B[N-1]
D=B[N-2]
for i in range(N):
	if A[i]>D:
		print(D)
	else:
		print(C)


### FIXED CODE ###

import copy
N = int(input())
S = []
for i in range(N):
    S.append(int(input()))

B=copy.copy(S)
B.sort()
if N>2:
	C=int(B[N-1])
	D=int(B[N-2])
	for i in S:
		if int(i)>=C:
			print(D)
		else:
			print(C)

else:
	print(S[1])
	print(S[0])
a, b = map(int, input().split())

count = 0
for i in range(a, b + 1):
    l = list(i)
    up = l[:(len(l) // 2) - 1]
    if len(l) % 2 == 0:
        dowm = reverse(l[len(l) // 2:])
    else:
        dowm = reverse(l[(len(l) // 2) + 1:])
    if up == down:
        count += 1
print(count)

### FIXED CODE ###

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

count = 0
for i in range(a, b + 1):
    l = list(str(i))
    up = l[:(len(l) // 2)]
    if len(l) % 2 == 0:
        down = l[len(l) // 2:]
        down.reverse()
    else:
        down = l[(len(l) // 2) + 1:]
        down.reverse()
    if up == down:
        count += 1

print(count)
import sys
import math
import bisect
def input():
    return sys.stdin.readline()[:-1]

n,u,v = map(int,input().split())
u-=1
v-=1
g = [[]for i in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    a-=1
    b-=1
    g[a].append(b)
    g[b].append(a)
seen = [-1 for i in range(n)]
taka = []
aok = []
def dfs(s,lis):
    nec = g[s]
    if len(nec)==1:
        lis.append(s)
    for i in nec:
        if seen[i]!=-1:
            continue
        seen[i] = seen[s]+1
        dfs(i,lis)

seen[u]=0
dfs(u,taka)
takadist = [i for i in seen]
seen = [-1 for i in range(n)]
seen[v]=0
dfs(v,aok)
ans = 0
for i in aok:
    if takadist[i]<seen[i]:
        ans = max(ans,seen[i])
if g[u]==[v]:
    print(0)
else:
    print(ans-1)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10000000)
import math
import bisect
def input():
    return sys.stdin.readline()[:-1]

n,u,v = map(int,input().split())
u-=1
v-=1
g = [[]for i in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    a-=1
    b-=1
    g[a].append(b)
    g[b].append(a)
seen = [-1 for i in range(n)]
taka = []
aok = []
def dfs(s,lis):
    nec = g[s]
    if len(nec)==1:
        lis.append(s)
    for i in nec:
        if seen[i]!=-1:
            continue
        seen[i] = seen[s]+1
        dfs(i,lis)

seen[u]=0
dfs(u,taka)
takadist = [i for i in seen]
seen = [-1 for i in range(n)]
seen[v]=0
dfs(v,aok)
ans = 0
for i in aok:
    if takadist[i]<seen[i]:
        ans = max(ans,seen[i])
if g[u]==[v]:
    print(0)
else:
    print(ans-1)
a = int(input())
b = [int(i) for i in input().split()]
last = 1
for j,i in enumerate(b):
    last*=i
    if last > 10**18 and 0 not in b[j::]:
    	last = -1
        break


    
print(last)

### FIXED CODE ###

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

if 0 not in b:
  last = 1
  for i in b:
      last*=i
      if last > 10**18:
        last = -1
        break
    
else:
  last = 0
    
print(last)
#ABC125C-GCDonBlackboard.py

from sys import stdin
from fractions import gcd
from functools import reduce
from functools import lru_cache

input = stdin.readline

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

@lru_cache(maxsize=None)
def L(i):
    if i == 0:
        return 0
    else:
        return gcd(L(i-1),A[i-1])

@lru_cache(maxsize=None)
def R(i):
    if i == N:
        return 0
    else:
        return gcd(R(i+1),A[i])

M = []

for i in range(N):
    M.append(gcd(L(i), R(i+1)))

print(max(M))


### FIXED CODE ###

#ABC125C-GCDonBlackboard.py

from sys import stdin
from sys import setrecursionlimit
#import random
from fractions import gcd
from functools import lru_cache

setrecursionlimit(1000000)

input = stdin.readline

N = int(input())
A = list(map(int, input().split()))
#A = [random.randrange(1,10**9) for _ in range(N)]

@lru_cache(maxsize=None)
def L(i):
    if i == 0:
        return 0
    else:
        return gcd(L(i-1),A[i-1])

@lru_cache(maxsize=None)
def R(i):
    if i == N:
        return 0
    else:
        return gcd(R(i+1),A[i])

M = []

for i in range(N):
    M.append(gcd(L(i), R(i+1)))

print(max(M))
s = list(input())

result = []

for i in range(len(s)):
    if i == 1:
        if s[i] != 'B':
            result.append(s[i])
    else:
        if s[i] != 'B':
            result.append(s[i])
        else:
            result.pop()

print(''.join(result))

### FIXED CODE ###

s = str(input())

while 'B' in s:
    if s[0] == 'B':
        s=s[1:]
    s=s.replace('0B','')
    s=s.replace('1B','')

print(s)
import numpy as np

N = int(input())

"""
for i in range(1,int(N)+1):
    count = 0
    if i > 3:
        maxa = int(np.sqrt(i-2))
        for x in range(1,maxa):
            for y in range(1,maxa):
                for z in range(1,maxa):
                    if x*x+y*y+z*z+x*y+y*z+z*x > i:
                        break
                    if x*x+y*y+z*z+x*y+y*z+z*x == i:
                        count +=1

    print(count)

"""
ans = np.zeros(int(N))

maxa = int(np.sqrt(N-2))
for x in range(0,maxa):
    for y in range(0,x):
        for z in range(0,y):
            p = x*x+y*y+z*z+x*y+y*z+z*x
            if p<N+1:
                ans[p-1] += 6


for x in range(0,maxa):
    for y in range(0,x):
        p = x*x*3+y*y+x*y*2
        if p<N:
            ans[p-1] += 3


for x in range(0,maxa):
    p = x*x*6
    if p<N:
        ans[p-1] += 1

for x in range(0,N):
    print(int(ans[x]))

### FIXED CODE ###

import numpy as np

N = int(input())

ans = np.zeros(int(N))

if N<10001 and N>3:
    maxa = int(np.sqrt(N-2))
    for x in range(1,maxa):
        for y in range(1,x):
            for z in range(1,y):
                p = x*x+y*y+z*z+x*y+y*z+z*x
                if p<N+1:
                    ans[p-1] += 6


    for x in range(1,maxa):
        for y in range(1,x):
            p = x*x*3+y*y+x*y*2
            if p<N+1:
                ans[p-1] += 3
            p = y*y*3+x*x+x*y*2
            if p<N+1:
                ans[p-1] += 3

    for x in range(1,maxa):
        p = x*x*6
        if p<N+1:
            ans[p-1] += 1

for x in range(0,N):
    print(int(ans[x]))
import math
from collections import Counter

MOD = 10**9 + 7
N = int(input())

I = []
zz = 0
sz = 0
tz = 0
for _ in range(N):
    a,b = map(int, input().split())

    # (a, b) = (0, 0)
    if a == 0 and b == 0:
        zero += 1
        continue
    # (a, b) = (0, #)
    if a == 0:
        sz += 1
        continue
    # (a, b) = (#, 0)
    if b == 0:
        tz += 1
        continue

    gcd = math.gcd(a, b)
    if b < 0:
        a *= -1
        b *= -1
    I.append((a//gcd,b//gcd))

S = []
T = []
C = Counter(I)
for a, b in C.keys():
    if a > 0:
        S.append(C[(a,b)])
        T.append(C[(-b,a)])
    else:
        if C[(b,-a)] == 0:
            S.append(0)
            T.append(C[(a,b)])

ans = 1
ans *= 2**sz + 2**tz - 1
ans %= MOD
for i in range(len(S)):
    ans *= 2**S[i] + 2**T[i] - 1
    ans %= MOD
ans += zz  # (0, 0)
ans -= 1
print(ans % MOD)

### FIXED CODE ###

import math
from collections import Counter

MOD = 10**9 + 7
N = int(input())

I = []
zz = 0
sz = 0
tz = 0
for _ in range(N):
    a,b = map(int, input().split())

    # (a, b) = (0, 0)
    if a == 0 and b == 0:
        zz += 1
        continue
    # (a, b) = (0, #)
    if a == 0:
        sz += 1
        continue
    # (a, b) = (#, 0)
    if b == 0:
        tz += 1
        continue

    gcd = math.gcd(a, b)
    if b < 0:
        a *= -1
        b *= -1
    I.append((a//gcd,b//gcd))

S = []
T = []
C = Counter(I)
for a, b in C.keys():
    if a > 0:
        S.append(C[(a,b)])
        T.append(C[(-b,a)])
    else:
        if C[(b,-a)] == 0:
            S.append(0)
            T.append(C[(a,b)])

ans = 1
ans *= 2**sz + 2**tz - 1
ans %= MOD
for i in range(len(S)):
    ans *= 2**S[i] + 2**T[i] - 1
    ans %= MOD
ans += zz  # (0, 0)
ans -= 1
print(ans % MOD)
import math

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


A,B,C,D = map(int,input().split())
E = lcm(C,D)
c = (A-1)//C + 1
d = (A-1)//D + 1
e = (A-1)//E + 1
cde = [[c,C], [d,D], [e,E]]
cnt_cde = []
for x,y in cde:
    if x*y < B:
        cnt_cde.append((B-x*y)//y+1)
    elif x*y == B:
        cnt_cde.append(1)
    else :
        cnt_cde.append(0)
answer = B-A+1-(cnt_cde[0]+cnt_cde[1]-cnt_cde[2])
print(answer)
            

### FIXED CODE ###

import fractions
A,B,C,D = map(int,input().split())
c = B//C - (A-1)//C
d = B//D - (A-1)//D
E = (C*D)//fractions.gcd(C,D)
e = B//E - (A-1)//E
answer = B-A+1-(c+d-e)
print(answer)
n, x, m = map(int, input().split())

lst, num, frag = set(), [], False
for i in range(1, n + 1):
    lst.add(x), num.append(x)
    x = x ** 2 % m
    if x in lst:
        flag = True
        break

ans = sum(num)
if flag:
    cnt, idx = i, num.index(x)
    div, mod = divmod(n - cnt, len(num) - idx)
    ans += sum(num[idx:]) * div
print(ans)


### FIXED CODE ###

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

lst = set()
num = []
for i in range(1, n + 1):
    lst.add(x), num.append(x)
    x = x ** 2 % m
    if x in lst:
        cnt, idx = i, num.index(x)
        div, mod = divmod(n - cnt, len(num) - idx)
        ans = sum(num[:idx + mod])
        ans += sum(num[idx:]) * (div + 1)
        break
else:
    ans = sum(num)
print(ans)
N = int(input())
data = list(map(int, input().split()))

def ary_abs(data):
    for i in range(len(data)):
        data[i] = abs(data[i])


for i in data:
    count = 0
    if data <= 0:
        count += 1

if count % 2 == 0:
    # 負が 偶数 個のとき
    # 全てを正にした和
    ary_abs(data)
    print(sum(data))
else:
    # 負が 奇数 個のとき
    # どれか一つを負(最小のもの)
    ary_abs(data)
    print(sum(data) - min(data) * 2)


### FIXED CODE ###

# 解説を見て書いたコード
N = int(input())
data = list(map(int, input().split()))
count = 0

def ary_abs(data):
    for i in range(len(data)):
        data[i] = abs(data[i])


for i in data:
    if i <= 0:
        count += 1

if count % 2 == 0:
    # 負が 偶数 個のとき
    # 全てを正にした和
    ary_abs(data)
    print(sum(data))
else:
    # 負が 奇数 個のとき
    # どれか一つを負(最小のもの)
    ary_abs(data)
    print(sum(data) - min(data) * 2)
card, gate = map(int, input().split())
l, r = map(int, input().split())
ans = {i for i in range(l, r+1)}
for i in range(gate-1):
  l, r = map(int, input().split())
  l, r = max(min(ans), l), min(max(ans), r)
  ans = {i for i in range(l, r+1) if i in ans}
print(len(ans))

### FIXED CODE ###

card, gate = map(int, input().split())
max_l = 0
min_r = 100000
for i in range(gate):
  l, r = map(int, input().split())
  max_l = max(max_l, l)
  min_r = min(min_r, r)
print(len(range(max_l, min_r+1)))
N, L=map(int, input().split())
s=[]
for i in range(n):
  s.append(input())
print(''.join(sorted(s)))

### FIXED CODE ###

# 入力
N,L=map(int,input().split())

l=[]
for i in range(N):
  l.append(input())

# ソート
l.sort()

# 出力
print(''.join(l))
for e in iter(input,'0 0'):
 H,W=map(int,e.split())
 s=[[*map(int,input().split())]for _ in[0]*H]
 print(max(sum(max(sum(c),H-sum(c))for x in range(2**H)for c in zip([c^int(b)for c in r]for r,b in zip(s,bin(x)[2:].zfill(H))))))


### FIXED CODE ###

def v():
 for e in iter(input,'0 0'):
  r=int(e.split()[0])
  d=[int(''.join(x),2)for x in zip(*[input().split()for _ in[0]*r])]
  a=0
  for m in range(1<<~-r):
   t=0
   for s in d:
    c=bin(m^s).count('1')
    t+=max(c,r-c)
   if a<t:a=t
  print(a)
if'__main__'==__name__:v()
a = int(input())
b = []
for i in range(a):
  b.append(int(input()))

b.sort()

b[-1::] == b[-1::] / 2

print(sum(b))

### FIXED CODE ###

a = int(input())
b = []
for i in range(a):
    b.append(int(input()))

b.sort()

b[-1] = b[-1] / 2

print(int(sum(b)))
a, b, c = map(int, input().split())
if a + b >= c:
    print('No')
elif a**0.5+b**0.5-c**0.5 < 1e-30:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

dataset = (1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
k = int(input())
print(dataset[k-1])
N = int(input() )

for i in range(N):
  A, B = map(int, input().split() )
  C[i] = [A, B]
C.sort(key=lambda s:s[1] )
 
judge = "Yes"
time = 0
for i in range(N):
  time += C[i][0]
  if time > C[i][1]:
    judge = "No"
    break
print(judge)

### FIXED CODE ###

N = int(input() )
C = []
for i in range(N):
  A, B = map(int, input().split() )
  C.append([A, B])
C.sort(key=lambda s:s[1] )
 
judge = "Yes"
time = 0
for i in range(N):
  time += C[i][0]
  if time > C[i][1]:
    judge = "No"
    break
print(judge)
import sys
def input():
	return sys.stdin.readline()[:-1]

n = int(input())
cnt = [[0 for _ in range(15)] for _ in range(15)]
ans = 0
for _ in range(n):
	a = input()
	x, y = 0, 0
	if "." in a:
		i = len(a)-1
		while a[i] != ".":
			i -= 1
			x, y = x-1, y-1
		b = int(a[:i] + a[i+1:])
	else:
		b = int(a)
	while b%2 == 0 and b > 0:
		x += 1
		b //= 2
	while b%5 == 0 and b > 0:
		y += 1
		b //= 5
	#print(x, y)
	x, y = x+9, y+9
	for i in range(18-x, 15):
		for j in range(18-y, 15):
			ans += cnt[i][j]
	cnt[x][y] += 1
print(ans)

### FIXED CODE ###

import sys
def input():
	return sys.stdin.readline()[:-1]

n = int(input())
cnt = [[0 for _ in range(20)] for _ in range(20)]
ans = 0
for _ in range(n):
	a = input()
	x, y = 0, 0
	if "." in a:
		i = len(a)-1
		while a[i] != ".":
			i -= 1
			x, y = x-1, y-1
		b = int(a[:i] + a[i+1:])
	else:
		b = int(a)
	#print(b)
	while b%2 == 0 and x < 9:
		x += 1
		b //= 2
	while b%5 == 0 and y < 9:
		y += 1
		b //= 5
	#print(x, y)
	x, y = x+9, y+9
	for i in range(18-x, 20):
		for j in range(18-y, 20):
			ans += cnt[i][j]
	cnt[x][y] += 1
print(ans)
N,K = list(map(int,input().split()))
P = list(map(int,input().split()))

def bubblesort(l):
    for index in range(len(l)-1, 0, -1):
        for low in range(index):
            if l[low] > l[low+1]:
                tmp = l[low+1]
                l[low+1] = l[low]
                l[low] = tmp
    return l

bubblesort(P)
sum = 0
for i in range(K):
	sum = sum + P[i]
print(sum)

### FIXED CODE ###

a = input()

if a.isupper():
	print("A")
else:
	print("a")
N, K = map(int, input().split())
S = input()

dup = 0
for i in range(1,N):
    if S[i] == S[i-1]:
        dup += 1
#print(min(N-1, dup + K*2))
print(min(N-1,dup + K * 2))

### FIXED CODE ###

n = int(input())

print(n**3)
H , W = map(int, input() .split())

if W == 1:
    N = 1
if W !=1:   
	if H % 2 ==0:
        N = H * W / 2
    
    if H == 1:
        N = 1
    else:
        N = int(H * W / 2) + 1

print(N)

### FIXED CODE ###

H , W = map(int, input() .split())

if W == 1:
    N = 1

elif H == 1:
    N = 1

else:   
    if H % 2 ==0:
        N = H * W / 2
        
            
    elif H % 2 ==1:
        if W % 2 ==0:
            N = H * W / 2
        else:
            N = int(H * W / 2) + 1

print(int(N))
def func():
    return

n = int(input())
# s = input()
# a, b = map(int, input().split())
a = list(map(int, input().split()))
# a = input().split()

'''
for i in range(n-1):
    for j in range(i+1, n):
        if a[i] == a[j]:
            print("NO")
            exit()
'''
ans = [0]*(max(a)+1)
for ida in a:
    if ans[ida] > 0:
        print("NO")
        exit()
    ans[ida] += 1

print("YES")

### FIXED CODE ###

def func():
    return

n = int(input())
# s = input()
# a, b = map(int, input().split())
a = list(map(int, input().split()))
# a = input().split()

ascA = sorted(a)
for i in range(n-1):
    if ascA[i] == ascA[i+1]:
        print("NO")
        exit()

'''
for i in range(n-1):
    for j in range(i+1, n):
        if a[i] == a[j]:
            print("NO")
            exit()
'''
'''
ans = [0]*(max(a)+1)
for ida in a:
    if ans[ida] > 0:
        print("NO")
        exit()
    ans[ida] += 1
'''

print("YES")
input_char = input()
a = int(input_char.split()[0])
b = int(input_char.split()[1])
unused_tap = 1
count = 0

if a > b:
    print(1)
    exit()

while(1):
    if unused_tap >= b:
        print(count + 1)
        break
    
    unused_tap = unused_tap-1 + a 
    count += 1

    

### FIXED CODE ###

S = input()
T = input()
days = 0

for i in range(3):
    if S == T:
        days = 3
        break
    if S[i] == T[i]:
        days += 1
    
print(days)
import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m)))
	if m%i==0:
		s.append(i)



for i in s
	if m%(i+1)==0 and m//(i+1)>n-1:
		x=max(x,i+1)
print(x)





### FIXED CODE ###

import math

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

x=0

s = []
for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		s.append(i+1)
		s.append(m//(i+1))




for i in s:
	if m%(i)==0 and m//(i)>n-1:
		x=max(x,i)
print(x)
k=int(input())
x=int(input())

if 500*k <= x:
    print("yes")
else:
    print("no")

### FIXED CODE ###

k,x=map(int,input().split())

if 500*k >= x:
    print("Yes")
else:
    print("No")
n,m=map(int,input().split())
print(1800*m+100*n)*2**m

### FIXED CODE ###

n,m=map(int,input().split())
print((1800*m+100*n)*2**m)
n, k = map(int, input().split())
a = (list)(map(int, input().split()))

# print(-(-(n-1)//(k-1)))
print((n+1 + (k - 2)) // (k-1))


### FIXED CODE ###

from functools import reduce
n = (int)(input())
a = (list)(map(int, input().split()))


def gcd(a, b):
    # a>b
  while(b):
    c = a % b
    a = b
    b = c
  return a


def calcMod(a, m):
  return sum([m % v for v in a])


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


def lcm_list(l):
  g = reduce(lcm, l)
  return g


def mul(a, b):
  return a*b


#print(calcMod(a, (int)(lcm_list(a)-1)))
print(calcMod(a, reduce(mul, a)-1))
X=int(input())
ans=[]
for i in range(-100,100):
  for j in range(-100,100):
    if((i**5)-(j**5)==X):
      ans.append((str(i)+" "+str(j)))
print(ans[0])

### FIXED CODE ###

X=int(input())
ans=[]
for i in range(1,1000):
  for j in range(-1000,1000):
    if((i**5)-(j**5)==X):
      ans.append((str(i)+" "+str(j)))
print(ans[0])
n = int(input())
li = list(111,222,333,444,555,666,777,888,999)

for i in range(9):
    if n <= li[i]:
        print(li[i])
        break


### FIXED CODE ###

n = int(input())
li =[111,222,333,444,555,666,777,888,999]

for i in range(9):
    if n <= li[i]:
        print(li[i])
        break
from sys import stdin
input = sys.stdin

n = int(input())
aa = list(map(int, input().split()))
if 0 in aa:
  print(0)
  exit()
ans = 1
for a in aa:
  ans *= a
  if ans > 10**18:
    print(-1)
    exit()
print(ans)

### FIXED CODE ###

from sys import stdin
input = stdin.readline

n = int(input())
aa = list(map(int, input().split()))
if 0 in aa:
  print(0)
  exit()
ans = 1
for a in aa:
  ans *= a
  if ans > 10**18:
    print(-1)
    exit()
print(ans)
# coding=utf-8
S = int(input())

# 0と1の個数のうち、大きい方
cnt = 0
for i in range(len(S)):
    if S[i] == "0":
        cnt += 1
cnt = max(cnt, len(S) - cnt)
print(cnt)


### FIXED CODE ###

S = input()

ans = len(S)
for i in range(1, len(S)):
    if S[i-1] != S[i]:
        ans = min(ans, max(i, len(S)-i))

print(ans)
N=int(input())
a=[0]*(N-1)
b=[0]*(N-1)
c=[0]*(N-1)
d=[[] for _ in range(N)]
e=[ set() for _ in range(N)] #存在する色のリスト
maxi=0
for i in range(N-1):
    a[i],b[i] = map(int,input().split())
    d[a[i]-1].append(b[i]-1)
    d[b[i]-1].append(a[i]-1)
for j in d:
    maxi=max(maxi,len(j))
for i in range(N-1):
    pos=set([i+1 for in range(maxi)])
    pos= pos- e[a[i]-1] -e[b[i]-1]
    col=min(pos)
    c[i]=col
    e[a[i]-1].add(col)
    e[b[i]-1].add(col)
   
print(maxi)
for color in c:
    print(color)


### FIXED CODE ###

from collections import deque

N=int(input())
a=[0]*(N-1)
b=[0]*(N-1)
c=[set() for _ in range(N)] # 使用している色
d=[set() for _ in range(N)] # 隣接リスト
e=[ False for _ in range(N)] #訪問ずみかどうか
f=[0]*N  #答え
for i in range(N-1):
    a[i],b[i] = map(int,input().split())
    d[a[i]-1].add(b[i]-1)
    d[b[i]-1].add(a[i]-1)

maxi=max([len(d[i]) for i in range(N-1)])
print(maxi)
#print("c:",c)
#print("d",d)
#print("e",e)

#x=0としてBFSする

v=deque([0])
e[0]=True
color=1

while v:
  p = v.popleft()
  for q in d[p]:
    if e[q]==False:
      while color in c[p]:
        color +=1
        if color>maxi:
          color=1
      c[p].add(color)
      c[q].add(color)
      f[q]=color
      e[q]=True
      v.append(q)
      
for i in range(N-1):
  print( f[b[i]-1])
import numpy as np
n = int(input())
a = list(map(int,input().split()))

ans = np.prod(a)
if ans >= 10**18:
    ans = -1
print(ans)


### FIXED CODE ###

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

if 0 in a:
    print(0)
    exit()

c = 1
for i in a:
    c *= i
    if c > 10 ** 18:
        print(-1)
        exit()

print(c)