Given N integers A_1, ..., A_N, compute A_1 \times ... \times A_N.
However, if the result exceeds 10^{18}, print -1 instead.

-----Constraints-----
 - 2 \leq N \leq 10^5
 - 0 \leq A_i \leq 10^{18}
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
N
A_1 ... A_N

-----Output-----
Print the value A_1 \times ... \times A_N as an integer, or -1 if the value exceeds 10^{18}.

-----Sample Input-----
2
1000000000 1000000000

-----Sample Output-----
1000000000000000000

We have 1000000000 \times 1000000000 = 1000000000000000000.
[{"code": "from typing import List\n\n\ndef answer(n: int, a: List[int]) -> int:\n    if 0 in a:\n        return 0\n\n    max_value = 10 ** 18\n    product = 1\n    for i in a:\n        product *= i\n        if max_value < product:\n            return -1\n\n    return product\n\n\ndef main():\n    n = int(input())\n    a = list(map(int, input().split()))\n    print(answer(n, a))\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 15236.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\nans = 1\nA.sort()\n\nfor i in range(N):\n    ans *= A[i]\n    if ans > 1e18:\n        print(-1)\n        return\n\nprint(ans)", "passed": true, "time": 0.17, "memory": 14140.0, "status": "done"}, {"code": "i=input;i();l=i().split();x=1-('0'in l)\nfor j in l:\n  x*=int(j)\n  if x>1e18:x=-1;break\nprint(x)\n", "passed": true, "time": 0.27, "memory": 14104.0, "status": "done"}, {"code": "input();l=input().split();x=not\"0\"in l\nfor j in l:x=x*int(j)if 0<=x*int(j)<=1e18else-1\nprint(x)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n  print(0)\n  return\nelse:\n  flag = True\n  prd = 1\n  A.sort(reverse=True)\n  for i in range(N):\n    prd *= A[i]\n    if prd > 10**18:\n      flag = False\n      break\nif flag:\n  print(prd)\nelse:\n  print(-1)", "passed": true, "time": 0.21, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\naa = list(map(int, input().split()))\n\nif 0 in aa:\n    print('0')\n    return\n\nresult = 1\nfor a in aa:\n    result *= a\n    if result > pow(10, 18):\n        print('-1')\n        return\n\nprint(result)\n", "passed": true, "time": 0.15, "memory": 14124.0, "status": "done"}, {"code": "n=int(input())\nl=list(map(int,input().split()))\n# print(l)\nans=1\nif 0 in l:\n    print(0)\n    return\nfor i in l:\n    ans*=i\n    if ans> 10**18:\n        # print(ans)\n        print(-1)\n        return\nprint(ans)", "passed": true, "time": 0.19, "memory": 14344.0, "status": "done"}, {"code": "import math\nimport decimal\ndef i_input(): return int(input())\n\n\ndef i_map(): return map(int, input().split())\n\n\ndef i_list(): return list(map(int, input().split()))\n\n\ndef i_row(N): return [int(input()) for _ in range(N)]\n\n\ndef i_row_list(N): return [list(map(int, input().split())) for _ in range(N)]\n\nn= i_input()\naa=i_list()\naa.sort()\nans=1\nfor a in aa:\n    ans*=a\n    if ans>10**18:\n        ans=-1\n        break\nprint(ans)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\n\nans = 1\nif 0 in a:\n    print((0))\n    return\nelse:\n    for i in a:\n        ans *= i\n        if ans > 10**18:\n            print((-1))\n            return\n\nprint(ans)\n", "passed": true, "time": 0.3, "memory": 14244.0, "status": "done"}, {"code": "import math\n\n\ndef main():\n    n = int(input())\n    aList = list(map(int, input().split()))\n    sumA = 1\n    if aList.count(0) > 0:\n        print((0))\n        return\n    for a in aList:\n        sumA *= a\n        if sumA > 10 ** 18:\n            print((-1))\n            return\n    print(sumA)\n\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.25, "memory": 14088.0, "status": "done"}, {"code": "import sys\n\nn = int(input())\nA = sorted(list(map(int,input().split())))\nans = 1\n\nif A[0] == 0:\n    print((0))\nelse:\n    for i in range(len(A)):\n        ans *= A[i]\n        if ans > 10**18:\n            print((-1))\n            return\n    print(ans)\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "i=input;i();l=i().split();x=1-('0'in l)\nfor j in l:\n  x*=int(j);\n  if x>1e18:x=-1;break\nprint(x)", "passed": true, "time": 0.17, "memory": 14100.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\nsum_=1\nif 0 in a:\n    print (0)\nelse:\n    for i in range(N):\n        sum_ *= a[i]\n        if sum_> 10**18:\n            sum_ =-1\n            break\n    print(sum_)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "import sys\n\ninput = sys.stdin.readline\nN = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n    print(0)\nelse:\n    ans = 1\n    for a_i in A:\n        ans *= a_i\n        if ans > 10**18:\n            print(-1)\n            return\n    print(ans)", "passed": true, "time": 0.21, "memory": 14172.0, "status": "done"}, {"code": "n = int(input())\naaa = sorted(map(int, input().split()))\nans = 1\nlimit = 10 ** 18\nfor a in aaa:\n    ans *= a\n    if ans > limit:\n        ans = -1\n        break\nprint(ans)", "passed": true, "time": 0.15, "memory": 14192.0, "status": "done"}, {"code": "\ndef i_input(): return int(input())\ndef i_map(): return map(int, input().split())\ndef i_list(): return list(map(int, input().split()))\ndef i_row(N): return [int(input()) for _ in range(N)]\ndef i_row_list(N): return [list(map(int, input().split())) for _ in range(N)]\n\nn=i_input()\naa=i_list()\naa.sort()\nans=1\ninf=10**18\nfor a in aa:\n    ans*=a\n    if ans>inf:\n        ans=-1\n        break\nprint(ans)", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "n = int(input())\nmod = 10**18\nli = list(map(int, input().split()))\nli.sort()\nans = 1\nfor i in range(n):\n    ans *= li[i]\n    if ans > mod:\n        ans = -1\n        break\nprint(ans)\n", "passed": true, "time": 0.24, "memory": 14080.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\nAA = 1\n\nif 0 in A:\n  print(0)\n  return\n\nfor i in range(N):\n  AA *= A[i]\n  if AA > 10**18:\n    print(-1)\n    return\n\nprint(AA)", "passed": true, "time": 0.24, "memory": 14112.0, "status": "done"}, {"code": "i=input;i();l=i().split();x=1-('0'in l)\nfor j in l:\n  x*=int(j)\n  if x>1e18:x=-1;break\nprint(x)\n", "passed": true, "time": 0.15, "memory": 14224.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\nans = 1\nif 0 in A:\n  print(0)\n  return\n  \nfor i in range(N):\n  ans *= A[i]\n  if ans > 10**18:\n      print(-1)\n      return\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14380.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\n\nif 0 in A:\n    print(0)\n    return\nproduct = 1\nfor num in A:\n    product = product * num\n    if product > 10 ** 18:\n        print(-1)\n        return\n\nprint(product)", "passed": true, "time": 0.15, "memory": 14132.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\nresult = 1\nif 0 in A:\n    print(0)\nelse:\n    for i in A:\n        result *= i\n        if result > 10 ** 18:\n            print(\"-1\")\n            break\n    else:\n        print(result)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "num=int(input())\nline=input().split(\" \")\nchecklis=sorted(line)\nif checklis[0]==\"0\":\n    res=0\nelse:\n    res=1\n    i=0\n    while res<=1000000000000000000 and i<num:\n        res *= int(line[i])\n        i+=1\n        \n    if res>1000000000000000000:\n        res= -1\n \nprint(res)\n", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy,bisect\n#from operator import itemgetter\n#from heapq import heappush, heappop\n#import numpy as np\n#from scipy.sparse.csgraph import breadth_first_order, depth_first_order, shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson\n#from scipy.sparse import csr_matrix\n#from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN\nimport sys\n\nsys.setrecursionlimit(10**7)\ninf = 10**20\nmod = 10**9 + 7\n\nstdin = sys.stdin\n\nni = lambda: int(ns())\nnf = lambda: float(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nnb = lambda: list(map(float, stdin.readline().split()))\nns = lambda: stdin.readline().rstrip()  # ignore trailing spaces\n\nmax_ = 10 ** 18\nN = ni()\nA = na()\nA.sort()\nans = 1\nfor i in range(N):\n    ans *= A[i]\n    if ans > max_:\n        ans = -1\n        break\nprint(ans)", "passed": true, "time": 0.25, "memory": 14200.0, "status": "done"}, {"code": "n = int(input())\na = list( map (int , input().split() ) )\na.sort()\nans = 1\nfor i in range(n):\n    ans*=a[i]\n    if ans>10**18:\n      print((-1))\n      return\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14128.0, "status": "done"}, {"code": "n=int(input())\na=sorted([int(x) for x in input().split()])\n\nif a[0]==0: print(0); return\nans=1\nfor ai in a:\n  ans*=ai\n  if ans>10**18: print(-1); break\nelse:\n  print(ans)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "N=int(input())\na=list(map(int,input().split()))\n\nans=1\nif (0 in a):\n\tprint(0)\nelse:\n\tfor i in range(0,N):\n\t\tans=ans*a[i]\n\t\tif ans > 10**18:\n\t\t\tprint(-1)\n\t\t\tbreak\n\n\tif ans <= 10**18:\n\t\tprint(ans)", "passed": true, "time": 0.16, "memory": 14224.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\ndef solve(a):\n    ans = 1\n    if 0 in a:\n        return 0\n    for i in a:\n        ans *= i\n        if ans > pow(10, 18):\n            return -1\n    return ans\nans = solve(a)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n = input()\na = list(map(int,input().split()))\nMX = 10**18\nans = 1\nfor i in a:\n  if i == 0:\n    print(0)\n    return\nfor i in a:\n    ans *= i\n    if ans > MX:\n      print(-1)\n      return\nprint(ans)", "passed": true, "time": 0.23, "memory": 14232.0, "status": "done"}, {"code": "def calc():\n    n = int(input())\n\n    a = list(map(int, input().split()))\n\n    \n    if 0 in a:\n        print(0)\n        return \n\n    ans = 1\n\n    for i in range(len(a)):\n        ans *= a[i]\n        if ans > 10 ** 18:\n            print(-1)\n            return \n    print(ans)\n\n\ncalc()", "passed": true, "time": 0.16, "memory": 14192.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\n\n\ndef ans():\n    if 0 in A:\n        return print(0)\n    product = 1\n    for num in A:\n        product = product * num\n        if product > 10 ** 18:\n            return print(-1)\n\n    print(product)\n\n\nans()", "passed": true, "time": 0.17, "memory": 14208.0, "status": "done"}, {"code": "input();a=1\nfor i in input().split():a*=int(i);a=[-1,a][0<=a<=10**18]\nprint(a)", "passed": true, "time": 0.19, "memory": 14080.0, "status": "done"}, {"code": "i=input;i();l=i().split();x=1-('0'in l)\nfor j in l:\n  x*=int(j)\n  if x>1e18:\n    x=-1;break\nprint(x)\n", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n= int(input())\na = list(map(int,input().split()))\nscore=1\nif 0 in a:\n  print(0)\n  return\nfor i in a:\n  score*=i\n  if score>10**18:\n    print(-1)\n    return\nprint(score)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n = input()\na = list(map(int,input().split()))\na.sort()\np = 1\nif a[0] == 0:\n    ans = 0\nelse:\n    for i in a:\n        p *= i\n        if p >10**18:\n            ans = -1\n            break\n        ans = p\nprint(ans)", "passed": true, "time": 0.18, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\nA = sorted(list(map(int, input().split())))\nans = 1\nfor a in A:\n    ans *= a\n    if ans > 10**18:\n        ans = -1\n        break\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14208.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int ,input().split()))\na=sorted(a)\nres=1\nfor i in range(n):\n    res*=a[i]\n    if res>10**18:\n        res=-1\n        break\nprint(res)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\n\nif 0 in a:\n    print(0)\n    return\n\nans = 1\nfor i in a:\n    ans *= i\n    if(ans > 10**18):\n        print(-1)\n        return\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "import random\nimport time\nimport copy\nimport io, sys\n\n#def pow(a, b):\n#    res = 1;\n#    for ()\n\nn = int(input())\na = list(map(int,input().split()))\n\nsum = 1\nfor a_ in a:\n    if (sum != -1): sum *= a_\n    if sum != 0 and sum > pow(10, 18):\n        sum = -1\n    if a_ == 0:\n        sum = 0\n        break\n\nprint(sum)\n", "passed": true, "time": 0.23, "memory": 14244.0, "status": "done"}, {"code": "N = int(input())\nA = [int(i) for i in input().split()]\nans = 1\nif(0 in A):\n    print(0)\n    return\nfor i in range(N):\n    ans *= A[i]\n    if(ans > 10 ** 18):\n        print(-1)\n        return\nprint(ans)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "N = int(input())\n\nA = list(map(int, input().split()))\nB = 0\nC = 1\n\nif 0 in A:\n    print(0)\n    return\n\nfor i in range(N):\n    C = C * A[i]\n    if C > 1000000000000000000:\n        print(-1)\n        return\n\nprint(C)", "passed": true, "time": 0.14, "memory": 14092.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\ns=1000000000000000000\nk,c=1,0\nfor i in a:\n    if k*i>s:\n        c=1\n        break\n    k*=i\nif 0 in a:\n    print(0)\n    \nelif c==0:\n    print(k)\nelse:\n    print(-1)", "passed": true, "time": 0.15, "memory": 14084.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\n\nresult = 1\nA = sorted(A)\n\nfor i in A:\n    result *= i\n    if result > 10 ** 18:\n        print((-1))\n        break\nelse:\n    print(result)\n\n\n", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "n = int(input())\nal = list(map(int, input().split()))\nans = 1\n\nif al.count(0) > 0:\n    print(0)\nelse:\n    for a in al:\n        ans *= a\n        if ans > 10**18:\n            print(-1)\n            return\n    print(ans)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\n\nalst = list(map(int, input().split()))\nif 0 in alst:\n  print(0)\n  return\n  \nelse:\n  ans = 1\n  for i in range(n):\n    ans *= alst[i]\n    if ans > 10**18:\n      print('-1')\n      return\n\n  print(ans)", "passed": true, "time": 0.14, "memory": 14344.0, "status": "done"}, {"code": "i=input;i();l=i().split();x=not '0' in l\nfor j in l:\n  x*=int(j)\n  if x>1e18:\n    print((-1));return\nprint(x)\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\n\nans = 1\nif 0 in set(a):\n    print((0))\n    return\nelse:\n    for i in range(n):\n        ans *= a[i]\n        if ans > 10**18:\n            print((-1))\n            return\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "input();l=input().split();x=1\nfor j in sorted(l):\n  x*=int(j)\n  if x>1e18:x=-1;break\nprint(x)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n = input()\na = list(map(int,input().split()))\nans = 1\na.sort()\nfor i in a:\n  ans *= i\n  if ans > 1000000000000000000:\n    print(-1)\n    return\nprint(ans)", "passed": true, "time": 0.33, "memory": 14296.0, "status": "done"}, {"code": "n = int(input())\nli = list(map(int, input().split()))\npr = 1\ngr = 0\nfor l in li:\n    pr = pr*l\n    if pr>10e17:\n        gr = 1\n        break\nif gr==1:\n    if 0 in li:\n        print((0))\n    else:\n        print(\"-1\")\nelse:\n  print(pr)\n", "passed": true, "time": 0.33, "memory": 14312.0, "status": "done"}, {"code": "n=int(input())\nl=list(map(int,input().split()))\nm=1\nl.sort()\nfor i in range(n):\n    m *= l[i]\n    if m>10**18:\n        print(-1)\n        return\n    \nprint(m)", "passed": true, "time": 0.21, "memory": 14056.0, "status": "done"}, {"code": "i=input;i();l=i().split();x=not'0'in l\nfor j in l:\n  x*=int(j);\n  if x>1e18:x=-1;break\nprint(x)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nans = 1\n\nfor i in A:\n    ans *= i\n    if ans > 10 ** 18:\n        print((-1))\n        break\nelse:\n    print(ans)\n\n\n", "passed": true, "time": 0.41, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\n\nif 0 in a:\n    print((0))\n    return\n\nm = 10**18\nans = 1\nfor x in a:\n    ans *= x\n    if ans > m:\n        print((-1))\n        return\n \nprint(ans)\n\n", "passed": true, "time": 0.23, "memory": 14104.0, "status": "done"}, {"code": "import sys\nN = int(input())\nlsA = list(map(int,input().split()))\nif 0 in lsA:\n    print(0)\n    return\nans = 1\nfor i in range(N):\n    ans *= lsA[i]\n    if ans > 10 ** 18:\n        print(-1)\n        return\nprint(ans)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "n = int(input())\ntmp = list(map(int, input().split()))\ntmp.sort()\nbound = int(10**18)\nans = 1\nfor i in range(0, n):\n    ans *= int(tmp[i])\n    if (ans > bound):\n        print((-1))\n        return\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}, {"code": "n=int(input())\na=list(map(int,input().split()))\nfor i in range(n):\n    if a[i]==0:\n        print(0)\n        return\ntmp=1\nfor i in range(n):\n    if a[i]<=(int(1e18)//tmp):tmp*=a[i]\n    else:\n        print(-1)\n        return\nprint(tmp)", "passed": true, "time": 0.2, "memory": 14160.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nans = 1\nif 0 in a:\n    print((0))\nelse:\n    for i in range(n):\n        ans *= a[i]\n        if ans > 10 ** 18:\n            print((-1))\n            break\n    else:\n        print(ans)\n", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "n = int(input())\n\na = list(map(int, input().split()))\n\nans = 1\n\nif 0 in a:\n    print(0)\n    return\n\nfor i in range(n):\n    ans *= a[i]\n    if ans > 10 ** 18:\n        print(-1)\n        return\n    \nprint(ans)", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "import sys\n\nn = int(input())\nli = list(map(int,input().split()))\nans = 1\n\nif 0 in li:\n    print(0)\n    return\n\nfor i in range(n):\n    ans = ans * li[i]\n    if ans > 10**18:\n        print(-1)\n        return\n\nprint(ans)", "passed": true, "time": 0.29, "memory": 14228.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nA = sorted(A)\nresult = 1\nfor i in range(N):\n  result *= A[i]\n  if result > 10**18:\n    result = -1\n    break\nprint(result)", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "dontt_use = input()\nstr_list = list(input().split())\nn = map(int,str_list)\n\ndef foo(n):\n    total = 1  \n    for number in n:\n        total = total * number\n        if total > 10**18:\n            print('-1')\n            return\n    print(total)\nif '0' in str_list :\n    print(0)\nelse:\n    foo(n)", "passed": true, "time": 0.23, "memory": 14244.0, "status": "done"}, {"code": "n = int(input())\naaa = sorted(map(int, input().split()), reverse=True)\nif aaa[-1] == 0:\n    ans = 0\nelse:\n    ans = 1\n    limit = 10 ** 18\n    for a in aaa:\n        ans *= a\n        if ans > limit:\n            ans = -1\n            break\nprint(ans)", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "import sys\nn = int(input())\na = list(map(int, input().split()))\n\nif a.count(0) > 0:\n  print(\"0\")\n  return\n  \nans = 1\nfor i in range(n):\n    ans *= a[i]\n    if ans > 10 ** 18:\n      print(\"-1\")\n      return\n    \nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "i=input;i();l=i().split();x=1-('0'in l)\nfor j in l:\n  x*=int(j)\n  if x>1e18:\n    print((-1));return\nprint(x)\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\nA = list(map(int, input().split()))\nif 0 in A:\n    print(0);return\nans = 1\nfor a in A:\n    ans *= a\n    if ans > 10**18:\n        print(-1);return()\nprint(ans)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "input();ans,a=1,[*map(int,input().split())]\nif 0 in a:\n  print(0)\nelse:\n  for i in a:\n    ans*=i\n    if ans>10**18:\n      print(-1);break\n  else:\n    print(ans)", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "input();x=1;*A,=map(int,input().split())\nif 0in A:print(0);return\nfor a in A:\n x*=a\n if x>10**18:print(-1);return\nprint(x)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int,input().split()))\nans = 1\nA.sort()\n\nfor i in range(N):\n    ans *= A[i]\n    if ans > 1e18:\n        print(-1)\n        break\nelse:\n    print(ans)", "passed": true, "time": 0.14, "memory": 14272.0, "status": "done"}, {"code": "N = int(input())\nA=list(map(int, input().split()))\n\nconst = 10**18\n\nif 0 in A:\n    print(0)\n    return\n\nresult = 1\nfor i in A:\n    result *= i\n    if result>const:\n        print(-1)\n        return\nprint(result)", "passed": true, "time": 0.14, "memory": 14376.0, "status": "done"}, {"code": "input();l=input().split();x=1\nfor j in sorted(l):\n  x*=int(j);\n  if x>1e18:x=-1;break\nprint(x)", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "n=int(input())\n\nA=list(map(int,input().split()))\nA.sort()\n\nans=int(1)\nfor i in range(n):\n    ans*=A[i]\n    if(ans>1e18):\n        print(-1)\n        return\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "input()\n\nn = list(map(int,input().split(\" \")))\nans = int(n[0])\nb = n[1:]\n\nif 0 in n:\n  ans = 0\nelse:\n  for i in b:\n    ans *= int(i)\n    \n    if ans > 10**18:\n      ans = -1\n      break\n    \nprint(ans)", "passed": true, "time": 0.22, "memory": 14244.0, "status": "done"}, {"code": "n=int(input())\n\nA=list(map(int,input().split()))\nA.sort()\n\nans=int(1)\n\nfor i in range(n):\n    ans*=A[i]\n    if ans>1e18:\n        print(-1)\n        return\nprint(ans)", "passed": true, "time": 0.23, "memory": 14216.0, "status": "done"}, {"code": "N = int(input())\nA = list(map(int, input().split()))\nA.sort()\nresult = 1\nfor i in range(N):\n  result *= A[i]\n  if result > 10**18:\n    result = -1\n    break\nprint(result)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "N=int(input())\nA = list(map(int,input().split()))\nanswer=1\n\nif 0 in A:\n  print((0))\n  return\n\nfor i in range(N):\n  answer*=A[i]\n  if answer > 10**18:\n    print((-1))\n    return\n\nprint(answer)\n\n", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "n=int(input())\nA=list(map(int,input().split()))\nMAX = 10**18\nans = 1\n\nfor a in A:\n  if a == 0:\n    print(0)\n    return\n\nfor a in A:\n  ans *= a\n  if MAX < ans:\n    print(-1)\n    return\nprint(ans)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "N = int(input())\nCONST = 10 ** 18\nresult = 1\nnumbers = list(map(int, input().split()))\nif 0 in numbers:\n    print(0)\n    return\nnumbers.sort(reverse=True)\nfor i in numbers:\n    result = result * i\n    if result > CONST:\n        print(-1)\n        return\nprint(result)", "passed": true, "time": 0.15, "memory": 14064.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int, input().split()))\nans = 1\nx = -1\nif 0 in a:\n    print((0))\n    return\nfor i in range(n):\n    x += 1\n    ans *= a[x]\n    if ans > 1e18:\n        print((-1))\n        return\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14208.0, "status": "done"}, {"code": "n = int(input())\nl = list(map(int,input().split())) \nif 0 in l:\n    print(\"0\")\n    return\nresult = l[0]\nl.pop(0)\nfor data in l:\n    result *= data\n    if result > 10 ** 18:\n        result = -1\n        break\nprint(result)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "N = int(input())\nnums = [int(i) for i in input().split()]\n\n\ndef calc(N, nums):\n    ans = 1\n    flg = False\n    if 0 in nums:\n        return 0\n    for i in range(N):\n        ans *= nums[i]\n        if ans > 10 ** 18:\n            flg = True\n            break\n    if flg:\n        return -1\n    else:\n        return ans\n\n\nprint(calc(N, nums))", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "n = int(input())\nl = list(map(int,input().split()))\nans = 1\n \nif(0 in l):\n  ans = 0\nelse:\n  for i in range(n):\n    ans=ans*l[i]\n    if(ans > 10**18):\n      ans = -1\n      break\nprint(ans)", "passed": true, "time": 0.14, "memory": 14364.0, "status": "done"}, {"code": "input();l=input().split();x=not'0'in l\nfor j in l:\n  x*=int(j);\n  if x>1e18:x=-1;break\nprint(x)", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "n = int(input())\na = list(map(int,input().split()))\nans = 1\nif 0 in a:\n    print(0)\nelse:\n    for i in range(n):\n        ans *= a[i]\n        if ans > 10 ** 18:\n            print(-1)\n            break\n    else:\n        print(ans)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}]