Harryxun/stf_run huggingface dataset:
import collections
N, M = map(int, input().split())
A = [0]*M
B = [0]*M
for i in range(M):
  A[i],B[i] = map(int,input().split())
ans = 0
f = [-1]*N
for i in range(M):
  if f[A[i]-1] == -1 and f[B[i]-1] == -1:
    f[A[i]-1] = i
    f[B[i]-1] = i
  elif f[A[i]-1] != -1 and f[B[i]-1] == -1:
    f[B[i]-1] = f[A[i]-1]
  else:
    f[A[i]-1] = f[B[i]-1]
ff = [i for i in f if i != -1]
print(max(collections.Counter(ff).values()))

### FIXED CODE ###

# cf. 16315733
N, M = list(map(int, input().split()))
# upperは、根なら-その木の長さを、枝ならその木の根の要素のインデックスを指す。
upper = [-1] * N
# xの根を返す
def root(x):
  # xが根なら
  if upper[x] < 0:
    return x
  # xが枝なら
  else:
    # 根のインデックスをさかのぼる
    upper[x] = root(upper[x])
    # 根のインデックスを返す
    return upper[x]

# x,yが同じグループにあるかどうか判定する
def equiv(x, y):
  return root(x) == root(y)

def unite(x, y):
  x, y = root(x), root(y)
  if x != y:
    if upper[y] < upper[x]:
      #xとyの値をスワップ、必ずupper[y] >= upper[x]とするつまりxのほうが高い
      x,y = y,x
    # 要素の数を足す：結合後の要素の数を求める
    upper[x] += upper[y]
    # yの根をxにする（木が高い方を根にする）
    upper[y] = x
  return x == y

for i in range(M):
  a, b = list(map(int, input().split()))
  unite(a-1, b-1)
print(-min(upper))
def findSumOfDigits(n):
    sum =0
    while n > 0:
        sum += n % 10
        n = n//10
    return sum

N = int(input())
examples = list()

for i in range(N)[1:round(N/2)]:
    A = i
    B = N - i
    total = findSumOfDigits(A) + findSumOfDigits(B)
    examples.append(total)

print(min(examples))

### FIXED CODE ###

def findSumOfDigits(n):
    sum =0
    while n > 0:
        sum += n % 10
        n = n//10
    return sum

N = int(input())
examples = list()

for i in range((N//2)+1)[1:]:
    A = i
    B = N - i
    total = findSumOfDigits(A) + findSumOfDigits(B)
    examples.append(total)

print(min(examples))
def setLine(tempH, line):
    for i in range(0, len(line)):
        geo[tempH][i] = line[i:i+1]

def solve():
    person = 0
    for i in range(0,H):
        for j in range(0,W):
            if geo[i][j] is not "_":
                search(i,j)
                person += 1
    print(person)

def search(i,j):
    temp = geo[i][j]
    geo[i][j] = "_"
    dx = [-1,0,1,0]
    dy = [0,-1,0,1]
    for a in range(0,4):
        idx = i + dx[a]
        jdy = j + dy[a]
        if(isOnMap(idx, jdy)):
            if(isNeededToSolve(temp, idx, jdy)):
                search(idx,jdy)

def isOnMap(i,j):
    return (0<=i and 0<=j and i<H and j<W)

def isNeededToSolve(temp,i,j):
    target = geo[i][j]
    return (target is not "_" and temp is target)

limit = 10**10
sys.getrecursionlimit(limit)

H = -1
W = -1
tempH = 0
geo = [[0 for i in range(1)]for j in range(1)]
repeat = True
while repeat:
    line = input()
    if H is -1 and W is -1:
        H = int(line.split(" ")[0])
        W = int(line.split(" ")[1])
        geo = [[0 for i in range(W)] for j in range(H)]
    else:
        setLine(tempH, line)
        tempH+=1

    #break
    if H is 0 and W is 0:
        break

    #solve
    if tempH is H:
        solve()
        H = -1
        W = -1
        tempH = 0

### FIXED CODE ###

import sys
def solve():
    person = 0
    for i in range(0,H):
        for j in range(0,W):
            if geo[i][j] is not "_":
                temp = geo[i][j]
                search(i,j,temp)
                person += 1
    print(person)

def search(i,j,temp):
    geo[i][j] = "_"
    for a in range(0,4):
        idx, jdy = i + dx[a], j + dy[a]
        if(isOnMap(idx, jdy)):
            if(isNeededToSolve(temp, idx, jdy)):
                search(idx,jdy, temp)

def isOnMap(i,j): return (0<=i and 0<=j and i<H and j<W)

def isNeededToSolve(temp,i,j):
    target = geo[i][j]
    return (target is not "_" and temp is target)

limit = 10**7
sys.setrecursionlimit(limit)

H, W, tempH = -1, -1, 0
dx = [-1,0,1,0]
dy = [0,-1,0,1]
geo = [[0 for i in range(1)]for j in range(1)]
while True:
    line = input()
    if H is -1 and W is -1:
        p = line.split(" ")
        H, W = int(p[0]), int(p[1])
        geo = [[0 for i in range(W)] for j in range(H)]
    else:
        geo[tempH] = list(line)
        tempH+=1
    if H is 0 and W is 0:break
    if tempH is H:
        solve()
        H, W, tempH = -1, -1, 0
N = int(input())
H = list(map(int, input().split()))
counts = []
i = 0

while True:
    count = 0
    if i == N-1:
        break
    for j in range(i+1, N):
        if H[j-1] < H[j]:
            i = j-1
            break
        count += 1
    counts.append(count)
    i += 1

print(max(counts))

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
count = 0
counts = []

if N <= 1:
    counts.append(0)
else:
    for i in range(N-1):
        if H[i] >= H[i+1]:
            count += 1
        else:
            counts.append(count)
            count = 0
    else:
        counts.append(count)

print(max(counts))
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
#print(gcd(a,b))

#最小公倍数
def lcm(a,b):
  return a*b//gcd(a,b)
#print(lcm(a,b)

a,b,c,d = list(map(int,input().split(" ")))
e = lcm(c,d)
p=a//c
o=b//c
i=a//d
u=b//d
y=a//e
t=b//e
C = max([0.o-p])
D = max([0,u-i])
E = max([0,t-y])
print( (b-a+1)-(C+D-E) )

### FIXED CODE ###

def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
#print(gcd(a,b))

#最小公倍数
def lcm(a,b):
  return a*b//gcd(a,b)
#print(lcm(a,b)

a,b,c,d = list(map(int,input().split(" ")))
e = lcm(c,d)
p=(a-1)//c
o=b//c
i=(a-1)//d
u=b//d
y=(a-1)//e
t=b//e
C = max([0,o-p])
D = max([0,u-i])
E = max([0,t-y])
print( (b-a+1)-(C+D-E) )
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l():
	return list(map(int,input().split()))
def m():
	return map(int,input().split())
def s(x):
	a = []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x):
	return " ".join(map(str,x))

q = m()
mod = 10**6+3
f = {}
f[0] = 1
for i in range(1,p):
	f[i] = d[i-1] * i % mod

for i in range(q):
	x,d,n = m()
	if d == 0:
		ans = pow(x,n,mod)
	else:
		x = x * pow(d,mod-2,mod)%mod
		if mod <= x + n - 1:
			ans = 0
		else:
			ans = pow(d,n,mod) * f[x+n-1] * pow(f[x-1],mod-2,mod) % mod
	print(ans)

### FIXED CODE ###

import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l():
	return list(map(int,input().split()))
def m():
	return map(int,input().split())
def s(x):
	a = []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x):
	return " ".join(map(str,x))

q = int(input())
mod = 10**6+3
f = {}
f[0] = 1
for i in range(1,mod):
	f[i] = f[i-1] * i % mod

for i in range(q):
	x,d,n = m()
	if d == 0:
		ans = pow(x,n,mod)
	else:
		x = x * pow(d,mod-2,mod)%mod
		if mod <= x + n - 1:
			ans = 0
		else:
			ans = pow(d,n,mod) * f[x+n-1] * pow(f[x-1],mod-2,mod) % mod
	print(ans)
from itertools import permutations

n=int(input())
np=factorial(n)
p_list=[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

ans=[]
for s,t,u in permutations(p_list,3):
  num1=(s**4)*(t**4)*(u**2)
  num2=(s**14)*(t**4)
  num3=(s**24)*(t**2)
  num4=s**74
  for z in [num1,num2,num3,num4]:
    if np%z==0:
      ans.append(z)

print(len(set(ans)))

### FIXED CODE ###

from math import factorial
from itertools import permutations

n=int(input())

np=factorial(n)

def eratosthenes(n):
 is_p=[1]*n
 p_list=[]

 is_p[0]=0
 is_p[1]=0

 for i in range(2,n):
  if is_p[i]:
   p_list.append(i)
   for j in range(i*i,n,i):
    is_p[j] = 0

 return is_p, p_list

lim=10**2+1
is_p, p_list=eratosthenes(lim)

cnt=0
ans=[]
l=len(p_list)
for i in range(l):
  for j in range(i+1,l):
    for k in range(j+1,l):
      for s,t,u in permutations([p_list[i],p_list[j],p_list[k]],3):
        num1=(s**4)*(t**4)*(u**2)
        num2=(s**14)*(t**4)
        num3=(s**24)*(t**2)
        num4=s**74
        for z in [num1,num2,num3,num4]:
          if np%z==0:
            ans.append(z)

print(len(set(ans)))
x=int(input("X:"))
y=int(input("Y:"))
z=x+y/2
print(z)


### FIXED CODE ###

number=input().split(" ")
x=int(number[0])
y=int(number[1])
z=x+y/2
print(int(z))
patterns = [None] * 10**5
patterns[0] = 1
patterns[1] = 1
calcurated_until = 1
MOD = 10**9+7
def get_patterns(n):
  global calcurated_until, patterns
  if patterns[n] is None:
    for i in range(calcurated_until + 1, n + 1):
      patterns[i] = (patterns[i-1] + patterns[i-2])%MOD
    calcurated_until = n
  #print('p', n, patterns[n])
  return patterns[n]

def solve():
  N, M = map(int, input().split())
  A = [-1]
  for _ in range(M):
    A.append(int(input()))
  A.append(N+1)
  #print(A)
  
  ans = 1
  for a1, a2 in zip(A[:-1], A[1:]):
    #print(a1, a2)
    if a2 == a1+1:
      print('0')
      return
    #print('ans', ans)
    #print('get_patterns(a2 - a1 - 2)', get_patterns(a2 - a1 - 2))
    ans *= get_patterns(a2 - a1 - 2)
    #print('ans', ans)
    ans %= MOD
    #print('ans', ans)
  print(ans)
solve()


### FIXED CODE ###

patterns = [None] * (10**5 + 10)
patterns[0] = 1
patterns[1] = 1
calcurated_until = 1
MOD = 10**9+7
def get_patterns(n):
  global calcurated_until, patterns
  if patterns[n] is None:
    for i in range(calcurated_until + 1, n + 1):
      patterns[i] = (patterns[i-1] + patterns[i-2])%MOD
    calcurated_until = n
  #print('p', n, patterns[n])
  return patterns[n]

def solve():
  N, M = map(int, input().split())
  A = [-1]
  for _ in range(M):
    A.append(int(input()))
  A.append(N+1)
  #print(A)
  
  ans = 1
  for a1, a2 in zip(A[:-1], A[1:]):
    #print(a1, a2)
    if a2 == a1+1:
      print('0')
      return
    #print('ans', ans)
    #print('get_patterns(a2 - a1 - 2)', get_patterns(a2 - a1 - 2))
    ans *= get_patterns(a2 - a1 - 2)
    #print('ans', ans)
    ans %= MOD
    #print('ans', ans)
  print(ans)
solve()
n=input()
k=int(input())
m=len(n)

DP=[[[0]*(k+1) for _ in range(2)] for _ in range(m+1)]
DP[0][0][0]=1

for i in range(1,m+1):
    for flag in range(2):
        num=9 if flag else int(n[i-1])
        for j in range(k+1):
            for k in range(num+1):
                if k!=0:
                    DP[i][flag or k<=num][j] +=DP[i-1][flag][j-1]
                else:
                    DP[i][flag or k<=num][j] +=DP[i-1][flag][j]
print(DP[-1][0][k]+DP[-1][1][k])

### FIXED CODE ###

N = input()
K = int(input())
m = len(N)
dp = [[[0] * (K + 1) for _ in range(2)] for _ in range(m + 1)]
dp[0][0][0] = 1

for i in range(1, m + 1):
    l = int(N[i - 1])
    for k in range(K + 1):
        dp[i][1][k] += dp[i - 1][1][k]
        if l != 0:
            dp[i][1][k] += dp[i - 1][0][k]
        else:
            dp[i][0][k] += dp[i - 1][0][k]
        if k - 1 >= 0:
            dp[i][1][k] += 9 * dp[i - 1][1][k - 1]
            if l != 0:
                dp[i][0][k] += dp[i - 1][0][k - 1]
                dp[i][1][k] += (l - 1) * dp[i - 1][0][k - 1]

print(dp[m][0][K] + dp[m][1][K])
import sys
from heapq import heapify, heappop, heappush

def solve():
    input = sys.stdin.readline
    N, M = map(int, input().split())
    Edge = [[] for i in range(N)]
    for i in range(1, N):
        Edge[i].append((0, i - 1))
    for _ in range(M):
        L, R, C = map(int, input().split())
        Edge[L-1].append((C, R-1))
    
    Dist = [-1] * N
    Q = []
    heapify(Q)
    heappush((0, 0))
    while Q:
        nowcost, nownode = heappop(Q)
        if Dist[nownode] == -1:
            Dist[nownode] = nowcost
            for addcost, nextnode in Edge[nownode]:
                if Dist[nownode] == -1:
                    heappush(Q, (nowcost + addcost, nextnode))
    print(Dist[N-1])

    return 0

if __name__ == "__main__":
    solve()

### FIXED CODE ###

import sys
from heapq import heapify, heappop, heappush

def solve():
    input = sys.stdin.readline
    N, M = map(int, input().split())
    Edge = [[] for i in range(N)]
    for i in range(1, N):
        Edge[i].append((0, i - 1))
    for _ in range(M):
        L, R, C = map(int, input().split())
        Edge[L-1].append((C, R-1))
    
    Dist = [-1] * N
    Q = []
    heapify(Q)
    heappush(Q, (0, 0))
    while Q:
        nowcost, nownode = heappop(Q)
        if Dist[nownode] == -1:
            Dist[nownode] = nowcost
            for addcost, nextnode in Edge[nownode]:
                if Dist[nextnode] == -1:
                    heappush(Q, (nowcost + addcost, nextnode))
    print(Dist[N-1])

    return 0

if __name__ == "__main__":
    solve()
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.insert(場所,要素)
-1で末尾で末尾から一つ前
'''


num = int(stdin.readline().rstrip())
data = stdin.readline().rstrip().split()
res = ''
for el in range(1, num + 1):
    res += str(data.index(str(el)) + 1) + ' '
print(res)


### FIXED CODE ###

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby

# 入力 =stdin.readline().rstrip()
# 分割 = stdin.readline().rstrip().split()

'''
条件に合うものを絞り込む
data = [1, 2, 3]
s = [x for x in data if x % 3 == 0]
'''

'''
文字配列を数値に
l_si = ['-10', '0', '100']

l_si_i = [int(s) for s in l_si]
'''

'''
a = [2, 4, 6, 8]
b = [3, 6, 9]

print(list(set(a) | set(b)))  # 和集合
print(list(set(a) & set(b)))  # 積集合
'''

'''
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
count = 0
while len([x for x in A if x % 2 == 0]) == N:
    A = list(map(lambda y: y / 2, A))
    count += 1
print(count)
'''

'''
.append(要素)
.insert(場所,要素)
-1で末尾で末尾から一つ前
'''


N = int(stdin.readline().rstrip())
T = list(range(1, N+1))
t = len([x for x in T if x % 2 == 1])
print(t/len(T))
# C - GeT AC
N, Q = map(int, input().split())
S = str(input())
A = [list(map(int, input().split())) for i in range(Q)]
S1 = []

for j in range(len(S)):
    if S[j] == 'A' and S[j + 1] == 'C':
        S1.append(j+1)
    else:
        pass

for i in range(Q):
    count = 0
    for k in range(len(S1)):
        if A[i][0] <= S1[k] < A[i][1]:
            count += 1
        else:
            pass
    print(count)

### FIXED CODE ###

# C - GeT AC
N, Q = map(int, input().split())
S = str(input())
A = [list(map(int, input().split())) for i in range(Q)]
S1 = [0]*N
count = 0
for j in range(1,len(S)):
    if S[j] == 'C' and S[j - 1] == 'A':
        count += 1
    else:
        pass
    S1[j] = count
#print(S1)

for k in range(Q):
    print(S1[A[k][1]-1]-S1[A[k][0]-1])
import sys
sys.setrecursionlimit(3000)
from operator import mul
from functools import reduce
def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

inf = input().split()
N = int(inf[0])
K = int(inf[1])
M = N-K
for i in range(1,K+1):
  red = cmb(M+1,i)
  blue = cmb(K-1,i-1)
  print(red*blue%(10**9+7))

### FIXED CODE ###

from operator import mul
from functools import reduce
 
def cmb(n,r):
    r = min(n-r,r)
    if r==0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

inf = input().split()
N = int(inf[0])
K = int(inf[1])
M = N-K
for i in range(1,K+1):
  if M+1<i:
    red = 0
  else:
    red = cmb(M+1,i)
  blue = cmb(K-1,i-1)
  print(red*blue%(10**9+7))
lst1 = [int() for i in input().split()]
lst2 = [int() for i in input().split()]
lst3 = [int() for i in input().split()]
n = int(input())
b = [int(input()) for i in range(n)]
lst4 = [lst1[0], lst2[0], lst3[0]]
lst5 = [lst1[1], lst2[1], lst3[1]]
lst6 = [lst1[2], lst2[2], lst3[2]]
lst7 = [lst1[0], lst2[1], lst3[2]]
lst8 = [lst1[2], lst2[1], lst3[0]]
if len(set(b) & set(lst4)) == 3:
    print('Yes')
elif len(set(b) & set(lst5)) == 3:
    print('Yes')
elif len(set(b) & set(lst6)) == 3:
    print('Yes')
elif len(set(b) & set(lst7)) == 3:
    print('Yes')
elif len(set(b) & set(lst8)) == 3:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = int(input())
if n % 2 == 0:
    print(int(n/2))
else:
    print(int(n//2+1))
n=int(input()
if n==1:
	print("Hello World")
else:
	a=int(input())
	b=int(input())
	print(a+b)

### FIXED CODE ###

n=int(input())
if n==1:
	print("Hello World")
else:
	a=int(input())
	b=int(input())
	print(a+b)
N, M = map(int, input().split())
H = list(map(int, input().split()))
H_val = [H[i] for i in range(N)]
for _ in range(M):
    A, B = map(int, input().split())
    A, B = A-1, B-1
    if H[A] > H[B]:
        H_val[B] = 0
        
    elif H[B] > H[A]:
        H_val[A] = 0
        
    else:
        H_val[A], H_val[B] = 0, 0

    print(H, H_val)

count = 0
for i in range(N):
    if H_val[i] != 0:
        count+= 1

print(count)


### FIXED CODE ###

N, M = map(int, input().split())
H = list(map(int, input().split()))
H_val = [H[i] for i in range(N)]
for _ in range(M):
    A, B = map(int, input().split())
    A, B = A-1, B-1
    if H[A] > H[B]:
        H_val[B] = 0
        
    elif H[B] > H[A]:
        H_val[A] = 0
        
    else:
        H_val[A], H_val[B] = 0, 0

count = 0
for i in range(N):
    if H_val[i] != 0:
        count+= 1

print(count)
n = list(int(input()))
ans = "No"
for i in range(0 , len(n)):
  if n[i] = 7
  ans = "Yes"
  break
print(ans)

### FIXED CODE ###

string = input()
list_of_integers =[int(d) for d in str(string)]

l = len(list_of_integers)
ans = "No"
for i in list_of_integers:
  if (i == 7):
    ans = "Yes"
  
print(ans)
s = input()
editor = [""]
for e in s:
    if e == "0":
        editor.append("0")
    elif e == "1":
        editor.append("1")
    elif e == "B" and editor != "":
        del editor[-1]
print("".join(editor))

### FIXED CODE ###

s = input()
editor = [""]
for e in s:
    if e == "0":
        editor.append("0")
    elif e == "1":
        editor.append("1")
    elif e == "B" and editor != []:
        del editor[-1]
print("".join(editor))
S = input()
T = input()

if S == T[0:-1]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N = int(input())
if N%10 in [2,4,5,7,9]:
  print('hon')
elif N%10 in [0,1,6,8]:
  print('pon')
else:
  print('bon')
from collections import Counter
n = input()
s = [list(input()).sort() for i in range(n)]
d = Counter(s)
count = 0
for i in d.values():
  if i !=1:
    count+=i
print(count)

### FIXED CODE ###

n = int(input())
d = dict()
for i in range(n):
  S = ''.join(sorted(list(input())))
  if S in d.keys():
    d[S] +=1
  else:
    d[S] = 1
 
ans = 0
for i in d.values():
  ans += i*(i-1)//2
print(ans)
N,Q = map(int, input().split())
s = input()
gorem = []
for _ in range(len(s)):
    gorem.append(1)
t = [input().split(" ") for i in range(Q)]
for i in t:
    tmp = []
    for j in range(len(s)):
        if s[j]==i[0]:
            tmp.append(j)
    if i[1]=='L':
        for _ in tmp:
            if _ == 0:
                gorem[_]=0
            else:
                gorem[_-1]+=gorem[_]
                gorem[_]-=gorem[_]
    else:
        for _ in tmp:
            if _ == len(s)-1:
                gorem[_]=0
               
            else:
                gorem[_+1]+=gorem[_]
                gorem[_]-=gorem[_]
                
print(sum(gorem))

### FIXED CODE ###

a = list(map(int, input().split()))
print('Yes') if a[0]==a[1]==a[2] else print('No')
n = input()
b = 1
a = list(map(str,input().split()))
if 0 in a:
    print(0)
else:
    for a in range(int(a)):
        b *= a[0]
    if b > 10**18:
        print(-1)
    else:
        print(b)

### FIXED CODE ###

n = int(input())
b = 1
a = list(map(int,input().split()))
if 0 in a:
    print(0)
else:
    for i in range(n):
        b *= a[i]
        if b > 10**18:
            print(-1)
            break
    if b <=10**18:
        print(b)
l = list(map(int,input().split()))
n = l[0]
d = l[1]

if n % (2d+1) == 0:
  print(n // (2d+1))
else:
  print(n // (2d+1) + 1)

### FIXED CODE ###

l = list(map(int,input().split()))
n = l[0]
d = l[1]

if n % (2*d+1) == 0:
  print(n // (2*d+1))
else:
  print(n // (2*d+1) + 1)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
from decimal import Decimal
decimal.getcontext().prec = 10

from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
import collections
from collections import deque 

def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
def _debug(obj):
    print(obj, file=sys.stderr)

# ---------------------------------------

N = inp()
p = [0] + list(map(Decimal, input().split()))
dp = [[0] * (N + 1) for i in range(N + 1)]
dp[0][0] = 1

for i in range(1, N+1):
    for j in range(0, i+1):
        if j > 0:
            dp[i][j] = dp[i-1][j] * (1 - p[i]) + dp[i-1][j-1] * p[i]
        else:
            dp[i][j] = dp[i-1][j] * (1 - p[i])
_debug(dp)
ans = 0
for j in range(N//2 + 1, N + 1):
    ans += dp[N][j]
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
import decimal
from decimal import Decimal
decimal.getcontext().prec = 10

from heapq import heappush, heappop, heapify
import math
from math import gcd
import itertools as it
import collections
from collections import deque 

def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
def _debug(obj):
    print(obj, file=sys.stderr)

# ---------------------------------------

N = inp()
p = [0] + list(map(float, input().split()))
dp = [[0] * (N + 1) for i in range(N + 1)]
dp[0][0] = 1

for i in range(1, N+1):
    for j in range(0, i+1):
        if j > 0:
            dp[i][j] = dp[i-1][j] * (1 - p[i]) + dp[i-1][j-1] * p[i]
        else:
            dp[i][j] = dp[i-1][j] * (1 - p[i])
ans = 0
for j in range(N//2 + 1, N + 1):
    ans += dp[N][j]
print(ans)
a = input()
b = input()

print(a * b)

### FIXED CODE ###

nums = input().split()

A = int(nums[0])
B = int(nums[1])

val = A * B

print(val)
a,b = map(int,input().split())
import math
print(math.ceil((a+b)/2)

### FIXED CODE ###

import math
a,b = map(int,input().split())
print(math.ceil((a+b)/2))
n, m = map(int, input().split())
x = list(map(int, input().split()))

x.sort()

sub_array = []
for i in range(len(x) - 1):
    sub_array.append(x[i+1] - x[i])

sub_array.sort()

for i in range(n-1):
    sub_array.pop(-1)

print (sum(sub_array))


### FIXED CODE ###

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

x.sort()

sub_array = []
for i in range(len(x) - 1):
    sub_array.append(x[i+1] - x[i])

sub_array.sort()

for i in range(n-1):
    if (len(sub_array) == 0):
        break
    sub_array.pop(-1)

print (sum(sub_array))
while 1:
    a, b, c = raw_input().split()
    if b == "?":
        break
    a = int(a)
    c = int(c)
    if b == "+":
        print a+c
    elif b == "*":
        print a*c
    elif b == "/"
        print a//c


### FIXED CODE ###

while True:
    a, b, c = input().split()
    a = int(a)
    c = int(c)
    ans = 0
    if b == "?":
        break
    elif b == "+":
        ans = a+c
    elif b == "-":
        ans = a-c
    elif b == "*":
        ans = a*c
    elif b == "/":
        ans = a//c
    print(ans)
s = list(input())
if("yes" if len(s) == len(set(s)) else "no")

### FIXED CODE ###

s = list(input())
print("yes" if len(s) == len(set(s)) else "no")
N = int(input())

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
M, n, m = 0, 0, 0

for i in range(1, 1000):
    m += 26**i
    if N <= m:
        M = N + 26**i -m
        n = i - 1
        break

for i in reversed(range(n + 1)):
    a, b = divmod(M, 26**i)
    M = b
    if i == 0:
        ans += s[a-1]
    else:
        ans += s[a]

print(ans)

### FIXED CODE ###

N = int(input())

s = "abcdefghijklmnopqrstuvwxyz"
ans = ""
n, m = 0, 0

for i in range(1, 1000):
    m += 26 ** i
    if N <= m:
        n = i
        break

for i in range(n):
    a, b = divmod(N, 26)
    N = a
    if b == 0:
        ans += s[25]
        N -= 1
    else:
        ans += s[b-1]

ans1 = ''.join(list(reversed(ans)))
print(ans1)