Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a= list(map(int,input().split())) 
 
if 0 in a:
    print(0)
    quit()
 
ans = 1
for i in a:
    ans *= i 
    
    if ans > 1000000000000000000:
        ans = -1
    

print(ans)
    


Fixed submission:
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        return
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            print(-1)
            return
    
    print(ans)
    
main(a)

Buggy python submission (verdict: Time Limit Exceeded):
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        quit()
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            ans = -1
    
    print(ans) 
    
main(a)


Fixed submission:
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        return
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            print(-1)
            return
    
    print(ans)
    
main(a)

Buggy python submission (verdict: Time Limit Exceeded):
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        quit()
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 10**18:
            ans = -1
    
    print(ans) 
    
main(a)


Fixed submission:
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        return
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            print(-1)
            return
    
    print(ans)
    
main(a)

Buggy python submission (verdict: Time Limit Exceeded):
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 

if 0 in a:
    print(0)
    quit()
 
ans = 1
for i in a:
    ans *= i 
    
    if ans > 10**18:
        ans = -1

print(ans) 


Fixed submission:
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        return
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            print(-1)
            return
    
    print(ans)
    
main(a)

Buggy python submission (verdict: Time Limit Exceeded):
import sys 
input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 

if 0 in a:
    print(0)
    quit()
 
ans = 1
for i in a:
    ans *= i 
    
    if ans > 10**18:
        ans = -1

print(ans) 


Fixed submission:
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        return
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            print(-1)
            return
    
    print(ans)
    
main(a)

Buggy python submission (verdict: Time Limit Exceeded):
import sys 
input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
from operator import mul
from functools import reduce
 
ans = 1
for i in a:
    ans *= i 
 
if ans > 10**18:
    print('-1')
else:
    print(ans) 


Fixed submission:
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        return
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            print(-1)
            return
    
    print(ans)
    
main(a)

Buggy python submission (verdict: Time Limit Exceeded):

import sys 
input = sys.stdin.readline


n = int(input())

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

from operator import mul
from functools import reduce



    
if reduce(mul, a) > 10**18:
    print('-1')
else:
    print(reduce(mul, a)) 


Fixed submission:
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        return
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            print(-1)
            return
    
    print(ans)
    
main(a)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import accumulate
from operator import add, mul
import sys 
input = sys.stdin.readline


n = int(input())

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


b = accumulate(a, mul)

c = list(b)


# b=1
# for i in range(n):
#     b *= a[i]
    
if c[n-1] > 10**18:
    print('-1')
else:
    # print(b)
    print(c[n-1])


Fixed submission:
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        return
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            print(-1)
            return
    
    print(ans)
    
main(a)

Buggy python submission (verdict: Time Limit Exceeded):
# from itertools import accumulate
# from operator import add, mul

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)


Fixed submission:
# import sys 
# input = sys.stdin.readline
 
 
n = int(input())
 
a= list(map(int,input().split())) 
 
def main(a):
    if 0 in a:
        print(0)
        return
     
    ans = 1
    for i in a:
        ans *= i 
        
        if ans > 1000000000000000000:
            print(-1)
            return
    
    print(ans)
    
main(a)