peterverebics/CodeNet_Python_118 huggingface dataset:
import sys
import numpy as np 

def input():
    return sys.stdin.readline().strip()
 
n = int(input())
A = list(map(int, input().split()))
aa = np.array(A)
sum = np.prod(aa)
if sum > 10**18:
    sum = -1
print(sum)
n = int(input())
a = list(map(int, input().split()))

ans = 1
for i in range(0, len(a)):
    ans = ans*int(a[i])

if ans > 100000000000000000:
    print(-1)
else:
    print(ans)
n = int(input())
l = list(map(int,input().split()))
anz = 1
flag = True
for i in l:
    anz *= i
    if anz > 1000000000000000000:
        flag = False
        break
print(anz if flag else -1)
n = int(input())
a = list(map(int,input().split()))
ans = 1
inf = 10 ** 18
if 0 in a:
    print(0)
    exit()
for x in a:
    ans *= x
    if ans >= inf:
        print(-1)
        exit()
print(ans)
n = int(input())
num = list(map(int,input().split(" ")))
 
zero=num.count(0)

if zero != 0:
  print(0)
else:
  s = num[0]
  for i in range(1,n):
    s = s * num[i]
  if len(str(s)) > 18:
    print(-1)
  else:
    print(s)
import numpy as np
N = int(input())
S = input()
S = S.split()
S = np.array([int(i) for i in S])
a = S.prod()
if(a <= np.power(10, 18)):
  print(a)
else:
  print(-1)
import numpy as np
 
N = int(input())
A = list(map(int, input().split()))  
a = 1
if 0 in A:
	print(0)
for i in range(N):
  a = a*A[i] 
  if (a > 10**18):
  	a = -1
print(a)
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
# from numba import njit


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

    Aset = set(A)

    if 0 in Aset:
        print(0)
        sys.exit()

    A.sort(reverse=True)

    res = 1
    INF = 10 ** 18

    for i in range(N):
        res *= A[i]
        if res > INF:
            res = -1

    print(res)



main()
import math
n = int(input())
r = list(map(int,input().split()))

lim = math.pow(10,18)

for i in range(n):
    if i == 0:
        x = r[i]
    else:
        x = x * r[i]

    if x > 1000000000000000000:
        break

if x > 1000000000000000000:
    x = -1

print(x)
N=int(input())
a=list(map(int,input().split()))
import sys

for i in range(N):
  if a[i]==0:
    print (0)
    sys.exit()
    
p=1
for i in range(N):
  p=p*a[i]
  if p>10**18:
    print (-1,p)
    sys.exit()

if p>10**18:
  print (-1)
else:
  print(p)
import numpy as np
N=int(input())
A=list(map(int, input().split()))
A_N=np.array(A)

ANS=np.prod(A_N)

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

for i in a:
    if i == 0:
        print(0)
        exit()

ans = 1
for i in a:
    if ans * i <= 1e18:
        ans *= i
        print(ans)
    else:
        print(-1)
        exit()
print(ans)
N = int(input())
a = list(map(int, input().split()))


for i in range(N):
  if (i == 0):
    ans = a[0]
  else:
    ans = ans * a[i]
    if (ans > 10**18):
      print('-1')
    else:
      print(ans)
import numpy as np

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

a_list = np.array(a_list, dtype = "int64")
ans = a_list.prod()

if ans > 10**18:
    ans = -1
print(int(ans))
n = int(input())
numbers = input().split(' ')
res = 1
for i in range(0, n):
    res *= int(numbers[i])
if res < 10**18:
    print(res)
else:
    print(-1)
def main():
  n =int(input())
  A = list(map(int, input().split()))

  if 0 in A:
    print(0)
    return

  p = 1
  for a in A:
    p *= a
    if p >= 10 ** 18:
      print(-1)
      return

  print(p)
main()
n = input()
s = input().split(" ")
ans = 1
for i in s:
  ans *= int(i)
if ans >= 1000000000000000000:
  print(-1)
else:	
  print(ans)
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
    exit()
a = sorted(a, reverse=True)
res = a[0]
for ai in a[1:]:
    res *= ai
    if res > 10**18:
        print(-1)
        exit()
def main():
  N=int(input())
  A = list(map(int, input().split()))
  if 0 in A:
    print(0)
    return
  S=1
  for a in A:
    S*=a
    if S>10^18:
      print(-1)
      return
  print(S)


main()
N=int(input())
AS = list(map(int,input().split()))
if 0 in AS:
  print(0)
  exit()
s = 0
sum = 1
l=len(AS)
for i in range(l):
  A=AS[i]
  if A==0:
    s=1
    break
  sum = sum * A
  if sum > 10**18:
    s=2
    break
if s==1:
  print(0)
elif s==2:
  print(-1)
else:
  if sum > 10**18:
    print(-1)
  else:
    print(sum)
print(s)
n = int(input())
a= input().split()
level = pow(10, 18)
product = 1

if 0 in a:
  print(0)
else:
  for num in range(n):
    product *= int(a[num])
    if product > level:
      print("-1")
      break
  if product <= level:
    print(product)
n = int(input())
c = 1
frag = True
a = list(map(int,input().split()))
for i in range(n):
    c *= a[i]
    if c > 10**18:
        print("-1")
        frag=False
        break
if frag: print(c)
import numpy as np

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

A = np.prod(A)
limit = 10 ** 18

print('-1' if A > limit else A)
n = int(input())
A = list(map(int, input().split()))
ans = 1
for a in A:
    ans *= a
    if ans > 10 ** 18:
        print(-1)
        exit()
print(ans)
N = int(input())
vals = [int(v) for v in input().split()]

rslt = 1

for v in vals:
  rslt = rslt * v
  
  if rslt > 10 ** 18:
    rslt = -1
    break
    
print(rslt)
n = int(input())
l = list(map(int,input().split()))
l = sorted(l, reverse = True)
sum = l[0]

f = True

a = 0 in l

b = 1000000000000000000

for i in range(1,n):
  if sum > b  and a==False:
    print(-1)
    f = False
    break
  sum *= l[i]

if f == True:
  print(sum)
def aaa(a_list):
    ans = 1
    for i in a_list:
        ans *= i
        if ans > 10**18 or ans < 0:
            return -1
    return ans

N = input()
a = map(int, input().split())
if 0 in a:
    print(0)
else:
    print(aaa(a))
n = int(input())
a = list(map(int, input().split()))

hg = 10 ** 18
ans = 1
for i in a:
    ans *= i
    if ans > hg:
        print(-1)
        break
print(ans)
import numpy as np
n = int(input())
l = np.array(list(map(int, input().split())))
b = 1
def multi(b,l):
    for a in l:
        b = b * a 
    if b > 10 ** 18:
        b = -1
    return b
b = multi(b,l)
print(b)
import sys
n = int(input())
print(n)
prod = 1
overflow = False

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

for aa in a:
  if prod * aa > 1000000 * 1000000 * 1000000:
    overflow = True
  else:
    prod = prod * aa

if overflow:
  print(prod)
else:
  print(-1)
def main():
    N = int(input())
    A = list(map(int,input().split()))
    
    if 0 in A:
        print(0)
        return

    prod = 1
    for a in A:
        prod *= a
        if prod > 1000000000000000000:
            print(-1)
            return
        print(prod)
main()
n = int(input())
list_a=list(map(int, input().split()))  #リスト入力
list_a.sort(reverse=True)
# list_a = sort(list_a)
result = 1
for i in list_a:
    result = result * i
    if len(str(result-1)) > 19:
        print(-1)
        break

if len(str(result)) <= 19:
    print(result)
import numpy as np
n=int(input())
a=list(map(int,input().split()))
c=np.prod(a)
if c>10**18:
  print('-1')
else:
  print(c)
n=int(input())
a=list(input().split())
ans=1
f=0
i=0
while(i<n):
    if f==0:
        ans=ans*int(a[i])
    if f==0 and ans>1000000000000000000:
        f=1
    if int(a[i])==0:
        print(0)
        exit()
    i+=2
if f==1:
    print(-1)
    exit()
print(ans)
num = int(input())
nums = list(map(int,input().split()))
ans = 1
for i in range(num):
    if nums[i] == 0:
        ans = 0
if ans != 0:
    for j in range(num):
        ans *= nums[j]
        if len(str(ans)) > 18:
            ans = -1
            break
print(ans)
N = int(input())

A = list(map (int, input().split()))
B = 1

for i in range(N):
    B *= A[i]
    if B >= 10**18:
        print(-1)
else:
    print(B)
N=int(input())
A=list(map(int,input().split()))
S=1
for i in range(N):
  S*=A[i]
if S>10*18:
  print(-1)
else:
  print(S)
import numpy as np
np.set_printoptions(suppress=True)

N = int(input())
A = np.array(list(map(int,input().split())),dtype=np.float64)

if np.any(A==0):
  print(0)
else:
  Souseki = np.prod(A) 
  if Souseki > np.power(10.,18):
    print(-1)
  else:
    print("{:.0f}".format(Souseki))
n = int(input())
l = list(map(str,input().split()))
pr= 1
for i in l:
    i = int(i)
    pr= pr* i
if len(str(pr))>18:
    print(-1)
else:
    print(pr)
N, result = eval(input()), 1
List = list(map(int, input().split()))
for i in List:
    result *= i
    
print(result)
N = int(input())
A = list(map(int, input().split()))

ans = 1
cond = 0
for a in A:
    ans *= a
    if ans > 10**18:
        cond = 1
        break

if cond:
    print(-1)
else:
    print(ans)
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prl = lambda x: print(*x ,sep='\n')

n = ni()
m = nl()
res = 1
for i in m:
    res *= i
    if res > 10**18 :
        print(-1)
        break
else:
    print(res)
import numpy as np
N = int(input())
A = list(map(int,input().split()))
B = np.array(A)
V = np.prod(B)
if V<= 10**18:
  print(V)
else:
  print('-1')
li = list(map(int,input().split()))
result = 1

for number in li:
	result = result * number
    
if 10**18 <= result:
	print(result)
else:
  	print(-1)
n = int(input())
nums = list(map(int, input().split()))

res = sum(nums)
if res > 1000000000000000000:
  print(-1)
else:
  print(res)
N = int(input())
l = list(map(int, input().split()))

ans = 1
for ll in l:
  ans *= ll
  if ans > 10**18:
    break
  
if ans > 10**18:
  print(-1)
else:
  print(ans)
N = int(input())
A = list(map(int, input().split()))

tmp = 1
for num in A:
    tmp *= num
    if tmp > 1e18:
      break
if tmp <= 1e18:
    print(tmp)
else:
    print(-1)
a=[]
a+=map(int,input().split())
if len(a) <= 10**18:
  for i in a:
    i *= i
  print(i)
else:
  print(-1)
import numpy as np
N = int(input())
A = list(map(int,input().split()))
s = 1
if 0 in A:
    print(0)
    exit(0)
s = np.prod(A)
if s > 10**(18):
    print(-1)
else:
    print(s)
N = int(input())
A = list(map(int, input().split()))
x = 0
m = A[0]

for x in range(1, N):
    m *= A[x]
    if m > 10**18:
        m = -1
        break
print(m)
def solve(n, a):
  if 0 in a:
    return 0
  else:
    p = 1
    x = 10**18
    for i in a:
      if p>x:
        return -1
      p*=i
    return p

n = int(input())
a = [int(x) for x in input().split()]
print(solve(n, a))
n=int(input())
tmp = 1
dat = list(map(int, input().split(" ")))

if 0 in dat:
    print ("0")
for d in dat:
    tmp *= d
    if tmp > 1000000000000000000:
        break

print (tmp)
import numpy as np

N = int(input())
AList = np.array(input().split(" "), dtype=np.int64)
result = AList.prod()

if result > 10 ** 18:
    print("-1")
else:
    print(result)
input()
r = 1
for x in input().split():
  if r > 0:
    r *= int(x)
    if r > 1e18:
      r = -1
print(r)
n=int(input())
l=list(map(int,input().split()))
p=1
flag=0
for i in range(n):
    if p>10**18:
        flag=1
        break
    else:
        p*=l[i]
if flag==0 or p<=10**18 :
  print(p)
else:
  print(-1)
a=int(input())
b=list(map(int,input().split()))
c=1
for i in range(a):
  if(b[i]==0):
    c=0
    break
  else:
    c=c*b[i]
  if(c>1000000000000000000):
    c=-1
    break
print(c)
N = int(input())
A = list(map(int,input().split()))

multi = 1
i = 0

for n in range(N):
    multi = multi*A[n]

if multi > 1000000000000000000:
    print(-1)
else:
    print(0)
import numpy as np
import sys
input = sys.stdin.readline

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

for i in a:
    ans = ans*i
    if ans >= 1000000000000000000:
        ans = -1
        exit
    elif ans == 0:
        exit

print(ans)
n = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range(n):
  ans *= A[i]
  if ans > 10**18:
    print(-1)
    exit()
print(ans)
nums = [int(i) for i in input().strip().split()]
result = 1
flag = True
for i in nums:
    result *= i
    if result > 10 ** 18:
        flag = False
        print("-1")
        break
if flag:
    print(result)
import numpy as np


_ = input()
A = list(map(int, input().split()))
res = np.prod(A)
if res > 10**18:
    print(-1)
else:
    print(res)
num = int(input())
num_list = input().split(" ")
result = 1
con = num >= 2 and num <= 100000
if con == True and num == len(num_list):
    for i in num_list:
        i = int(i)
        if i >= 0 and i <= 10000000000000000:
            result = result * i
    if result > 1000000000000000000:
        print(-1)
    else:
        print(result)
else:
    print()
import numpy as np


def main():
    s = [input() for l in range(2)]
    N, A_dct, A = int(s[0]), {int(x): int(x) for x in s[1].split()}, [int(x) for x in s[1].split()]
    if 0 in A_dct:
        print(0)
    else:
        tmp = np.prod(A)
        if tmp > 10**18: tmp = -1
        print(tmp)
    

if __name__ == '__main__':
    main()
n = int(input())
#a,b = map(int,input().split())
#a_L = list(map(int,input().split()))

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

print(ans)
n=input()
list1=map(int,input().split())
ans = 1
for i in list1:
    ans*=i
    if ans>1e18:
        ans=-1
        break
print(ans)
import numpy as np 
N=int(input())
A=list(map(int,input().split()))
count=1
count2=0
A=np.array(A)
if 0 in A:
	print(0)
else:
	for i in A:
		count*=i
		if count>10**18:
			print(-1)
			count2=1
			break
	if count2==0:
		print(count)
N = input()
Ai = input().split()
Ai = [int(Ai[k]) for k in range(int(N))]
K = Ai[0]
for i in range(1,int(N)):
  K = K * Ai[i]
  if K > 1000000000000000000:
    K = -1
    break
print(K)
import numpy as np

n = int(input())
a = np.array(list(map(int, input().split())))
p = np.prod(a, axis=0)
if p > 10**18:
    print(-1)
else:
    print(p)
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n= ii()
a= li()

ans=1
sorted(a, reverse=True)
if a[-1] == 0:
    print(0)
    exit()

for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        print(-1)
        exit()
    elif a[i] == 0:
        print(0)
        exit()
print(ans)
n=int(input())
lis=list(map(int,input().split()))
ans=1
for i in lis:
    ans*=i
    if ans>1000000000000000000:
        ans=-1
        break
if 0 in lis:
    ans=0
else:
    print(ans)
# coding: utf-8
import numpy as np

n = int(input())
numlist = list(map(int, input().split()))
ans = 1;

if np.prod(numlist) > 10**18:
    ans = -1
else:
    for i in numlist:
        if i == 0:
            ans = 0
            break
        ans *= i

print(ans)
from decimal import Decimal

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

ans = Decimal('1')
for i in a:
    ans = Decimal(str(ans * i))
    if ans > 10 ** 18:
        print(-1)
        exit()

print(ans)
# -*- coding: utf-8 -*-

import math

count = input()

lst = list(map(int, input().split()))

result = 1

for item in lst:
    result = result * item
    if (result > math.pow(10, 18)):
        print(-1)
        exit(0)

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

ans = 1
for i in range(N):
    if (ans > 10 ** 18):
        break
    ans *= A[i]

if (ans > 10**18):
    print(-1)
else:
    print(ans)
n = int(input())
A = list(map(int,input().split()))
total = 1
count = 0
for i in range(n):
    total *= A[i]
    if total > 10**18:
        count += 1
        break
if count == 1:
    print('-1')
else:
    print(total)
import sys
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
LIMIT = 10 ** 18
n=int(input())
#a=(int,read.split())
a=[int(i) for i in input().split()]
#if 0 in a:
#	print(0)
#	exit()

ans = 1
for i in a:
	ans *= i
	if ans > 10**18:
		print(-1)
		exit()
print(ans)
N = int(input())
A = list(map(int, input().split()))
A = sorted(A,reverse=True)
B = 1
if 0 in A:
    print(0)
    quit()
else:
    for i in A:
        B = B*i
        if B>= 10**18:  
            print(-1)
            quit()
print(B)
# coding: utf-8
# Your code here!
import numpy as np
 
n=int(input())
i = list(map(int, input().split()))
ans = np.prod(i)
 
if ans>1e18:
  ans=-1
  
print(ans)
import numpy as np

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

if np.any(A==0):
  print(0)
else:
  Souseki = np.prod(A)
  if Souseki > np.power(10.,18).astype(np.int16):
    print(-1)
  else:
    print("{:.0f}".format(Souseki))
import numpy as np
N = int(input())
A = list(map(int, input().split()))

if 0 in A:
    print("0")
else:
    arr_A = np.array(A)
    A = np.prod(arr_A)
    if A > 1000000000000000000:
        print ('-1')
    else:
        print(A)
n = int(input())
a = list(map(int, input().split()))
 
f = 1
for i in range(n):
    f = f*a[i]
    if  f>10**18:  
        print(-1)  
        exit()

print(f)
import numpy as np
N=int(input())
A=list(map(int,input().split()))

result=np.prod(A)

if result > 10**18:
    result=-1

print(result)
n = int(input())
li = list(map(int,input().split()))
a = 1
for i in li:
    a *= i
if a >= 1000000000000000000:
    print('-1')
else:
    print(a)
n = int(input())
a = list(map(int,input().split()))

if sorted(a)[0]==0:
    print(-1)
else:
    import math
    b = [math.log10(i) for i in a if i!=0]    
    if sum(b)>18:
        print(-1)
    else:
        z = 1
        for i in a:
            z*=i
        if z>10**18:
            print(-1)
        else:
            print(z)
import numpy as np
n = int(input())
a_list = np.array([int(x) for x in input().split()], dtype=np.int64)
ans = np.prod(a_list)
print(ans if ans <= np.int64(10 ** 18) else -1)
x1 = input()
x2 = [int(i) for i in input().split(" ")]
 
result = 1
for xv in x2:
   if xv == 0:
       result = 0
       break;

   result = xv * result
       
   if 10**18 < result : 
       result = -1
       break
print(result)
a = int(input())
b = list(map(int,input().split()))

n = 1
m = 1

aa = a/2

if a%2 == 1:
    aa = (aa*2+1)//2

for i in range(int(aa)):
  n = n * b[i]
  if n > 10**18:
    print('-1')
    exit()
  
for i in range(int(aa),a):
    m *= b[i]
    if m > 10**18:
      print('-1')
      exit()

if n * m > 10**18:
    print('-1')
else:
    print(n*m)
import  numpy as np

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

ans=np.prod(A)

if ans >= 10**18:
	print("-1")
	
else:
	print(ans)
N = int(input())
An = list(map(int, input().split()))
sum = 1
for i in range(N):
  sum *= An[i]
  if sum > 1e18:
    print(-1)
    quit()
  elif sum == 0:
    print(0)
    quit()
print(sum)
import sys
N = int(input())
A = list(map(int, input().split()))
ans = 1

if 0 in A:
    print(0)
    sys.exit()

for i in range(N):
    if A[i] <= (10**18 / ans):#普通だったらオーバーフローしないようにやる
        ans *= A[i]
    else:
        print(-1)
        sys.exit()

print(ans)
a = int(input())
b = list(map(int, input().split()))
c = b[0]
for i in range(a-1):
  c *= b[i+1]
  if c > 1000000000000000000:
    break

if c > 1000000000000000000:
  print(-1)
else:
  print(c)
listed = input().split()
mul = 1
for num in listed:
  num = int(num)
  if num == 0:
    mul = 0
    break
  if mul != -1:
    mul *= num
    if mul > 10**18:
      mul = -1
print(int(mul))
import numpy as np
n = int(input())
a = list(map(int,input().split()))

A = np.prod(a)
if A> 10**18:
    print("-1")
else:
    print(int(A))
n=int(input())
l=map(int,input().split())
k=1
for s in l:
    k=s*k
    if k>10**18:
        break

if k<=10**(18):
    print(k)
else:
    print('-1')
n = int(input())
a = list(map(int, input().split()))
x = 1
for i in range(n):
  x *= a[i] 
if x > 100000000000000001:
  x = -1
print(x)
n=int(input())
line=input().split(" ")
f=0

for i in line:
  if int(i)==0:
    print("0")
    f=1

g=1
if f==0:
  for i in line:
    g=g*int(i)
    if g>10**18:
      print("-1")
      f=1
  if f==0:
    print(g)
N = int(input())
a = list(map(int, input().split()))

ans = 1
for i in a:
    ans *= i
    if ans > 1000000000000000000:
        print(-1)
        exit()

print(ans)
N = int(input())
A = [int(i) for i in input().split()]
res = 1
for i in range(N):
    if A[i] == 0:
        res = 0
    elif A[i] > 0:
        res *= A[i];
    if abs(res) > 1e+18:
        res = -1

if res > 1e+18: print("-1")
else          : print(res)
N = int(input())
A = list(map(int,input().split()))

ans = 1
for a in A:
    ans *= a
    if ans == 0:
        break
    elif ans > 10**18:
        ans = -1
        break

print(ans)
import numpy as np
n = input()
a = list(map(int, input().split()))
if np.prod(a) > 10 ** 18:
  print(-1)
else:
  print(np.prod(a))
N=input();
N=int(N);
A=input().split();
print(A);
A = [int(s) for s in A];
sum =1;
for i in range(N):
  if(A[i]==0):
    sum=0;
    break;
  sum=sum*A[i];
  #print(sum);
if sum> (10**18):
  sum=-1;
print(sum);
N = int(input())
A = list(map(int,input().split()))
ans = 1
for i in A:
    ans *= i
if ans >= 10**8:
    ans = -1
print(ans)
num = int(input())
nums = list(map(int,input().split()))
ans = 1
error = -1
for j in nums:
    ans = ans * j
if(len(str(ans))>18):
    print(error)
else:
    print(ans)
import numpy as np
n = int(input())
l = np.array(list(map(int, input().split())))
b = l.prod()
if b > 10 ** 18:
    b = -1
print(b)
import numpy as np
n = int(input())
a = list(map(int, input().split()))

s = np.prod(a)

if (s > pow(10, 18)):
  print(-1)
else:
  print(s)
n = int(input())
a = [int(x) for x in input().split()]

c = False
for i in a:
    if i == 0:
        c = True
if c:
    print(0)
else:
    ans = 1
    for i in a:
        if ans > 1e18:
            ans = -1
            break
        ans *=i

    print(ans)
N = input()
nums = map(int, input().split())
ans = 1
for num in nums:
  ans *= num

print(ans if ans < 1e18 else -1)
n=int(input())
l=list(map(int,input().split()))
if l.count(0)!=0:
  print(0)
else:
  num=1
  for i in l:
    if num>10**18:
      break
    else:
      num*=i
  if num>=10**18:
    print(-1)
  else:
    print(num)
N = int(input())
A = list(map(int,input().split()))
anser = 1
if 0 in A:
    print(0)
for i in A:
    anser *= i
    if anser > 10 ** 18:
        print("-1")
print(anser)
n = int(input())
lis = list(map(int,input().split()))
a = 1
for i in range(n):
    a = a*lis[i]

print(a)
import numpy as np

N = int(input())
A = np.array(list(map(int,input().split())),dtype=np.int64)

if np.any(A==0):
  print(0)
else:
  Souseki = 1
  for i in range(N):
    Souseki *= A[i]
  if Souseki > 1000000000000000000:
    print(-1)
  else:
    print("{:.0f}".format(Souseki))
# coding: utf-8
# Your code here!

from collections import deque

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

for i in range(N - 1):
    ans *= A.popleft()
if ans >= pow(10, 18):
    print(-1)
else:
    print(ans)
import numpy as np
INF = 10 **18
N= int(input())
ans =1
A= list(map(int,input().split()))
# if 0 in A:
#     print(0)
# else:
def calc(A):
    ans = 0
    for  a in A:
        if ans == 0:
            ans = a
        else :
            ans *= a
        if ans > INF:
            # print(-1)
            return '-1'
    return ans

# ans = np.prod(A)
# ans = -1 if ans > INF else ans
print(calc(A))
n = int(input())
a = list(map(int, input().split()))
ans = 1

if 0 in a:
    ans = 0
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            ans = -1
        break

print(ans)
import numpy as np

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

multiple = np.prod(A)
if multiple >= 10 ** 18:
    print(-1)
else:
    print(multiple)
n = int(input())
a = list(map(int, input().split()))
cnt = 0
ans = 1
for i in range(n):
    ans *= a[i]
    if ans > 10 ** 18:
        print(-1)
        exit()
print(ans)
N = input()

ab = input( )

ab = ab.split()

SUM = 1
for i in range(int(N)):
    SUM = SUM * int(ab[i])
    
if (int(SUM) < 10 ** 18):
    print(SUM)
else:
    print(-1)
n = int(input())
x = input().split()
a = 0
b = 1
if x.count(0) >= 1:
  print(0)
else:
  while a <= n - 1 and b <= 1000000000000000000:
    b = b * int(x[a])
    a <= n - 1
  if b <= 1000000000000000000:
    print(b)
  else:
    print(-1)