Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import heapq, math, sys

N, K = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
maxA = A[0]
pre = -1
while len(A) != pre:
    if len(A) == 0:
        print(math.ceil(maxA))
        sys.exit()
    pre = len(A)
    meanA = math.ceil(sum(A)/(len(A)+K))
    for i, a in enumerate(A):
        if a <= meanA:
            A = A[:i]
            break


cuts = [0]*(i+1)
meanA = math.ceil(sum(A)/(len(A)+K))
for i, a in enumerate(A):
    cut_at_least = (a//meanA - 1)
    cuts[i] = cut_at_least
    K -= cut_at_least
hq = [(-a/(cut+1), i) for i, (a, cut) in enumerate(zip(A, cuts))]
heapq.heapify(hq)
lenhq = len(hq)
for k in range(K):
    l, i = heapq.heappop(hq)
    cuts[i] += 1
    heapq.heappush(hq, (-A[i]/(cuts[i]+1), i))
l, i = heapq.heappop(hq)
print(math.ceil(-l))


### FIXED CODE ###

import heapq, math, sys

N, K = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
maxA = A[0]
pre = -1
while len(A) != pre:
    if len(A) == 0:
        print(math.ceil(maxA))
        sys.exit()
    pre = len(A)
    meanA = math.ceil(sum(A)/(len(A)+K))
    for i, a in enumerate(A):
        if a <= meanA:
            A = A[:i]
            break


cuts = [0]*(i+1)
meanA = (sum(A)/(len(A)+K))
for i, a in enumerate(A):
    cut_at_least = (math.floor(a/meanA) - 1)
    cuts[i] = cut_at_least
    K -= cut_at_least
hq = [(-a/(cut+1), i) for i, (a, cut) in enumerate(zip(A, cuts))]
heapq.heapify(hq)
lenhq = len(hq)
for k in range(K):
    l, i = heapq.heappop(hq)
    cuts[i] += 1
    if k <= N:
        heapq.heappush(hq, (-A[i]/(cuts[i]+1), i))
l, i = heapq.heappop(hq)
print(math.ceil(-l))
### BUGGY CODE ###

A,B = map(int,input().split())
import math
def is_prime(n):
    if n == 1: return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True

def cf(x1,x2):
    cf=[]
    for i in range(2,min(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf

l = cf(A,B)
ans = []
for i in range(len(l)):
  if is_prime(l[i]) == True:
    ans.append(l[i])

print(len(ans)+1)

### FIXED CODE ###

import fractions
A,B = map(int,input().split())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

n = fractions.gcd(A,B)
print(len(set(prime_factorize(n)))+1)
### BUGGY CODE ###

N, K, Q = [int(s) for s in input().split(' ')]
A = [int(input()) for s in range(Q)]

# syoki_tokuten = [K for s in range(N)]
syoki_tokuten = [0 for s in range(N)]

for i in A:
  syoki_tokuten[i-1] += 1
  
for i in range(N):
  genten = sum(x for i_s,x in enumerate(syoki_tokuten) if i_s != i)

  if genten < K:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

from collections import Counter 

N, K, Q = [int(s) for s in input().split(' ')]
A = [int(input()) - 1 for s in range(Q)]

c = Counter(A)

sum = sum(c.values())

for i in range(N):
  
  if sum - c[i] < K:
    print('Yes')
  else:
    print('No')
### BUGGY CODE ###

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

m  = k
for i in range(n):
    b = a[i::] + a[0:i]
    r = 0
    for j in range(n-1):
        #print(r, b[j+1], b[j])
        if b[j] > b[j+1]:
            r = r + b[j+1] + (k - b[j])
        else:
            r = r + b[j+1] - b[j]
    m = min(m, r)
    #print(m,"kkkkk")
    
d = a[::-1]
for i in range(n):
    b = d[i::] + d[0:i]
    r = 0
    for j in range(n-1):
        #print(r, b[j+1], b[j])
        if b[j] > b[j+1]:
            r = r + b[j+1] + (k - b[j])
        else:
            r = r + b[j+1] - b[j]
    m = min(m, r)
print(m)

### FIXED CODE ###

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

maxdist = 0
for i in range(n-1):
    maxdist = max(maxdist, a[i+1] - a[i])
maxdist = max(maxdist, (k - a[-1]) + a[0])
    
print(k - maxdist)
### BUGGY CODE ###

def main():
    from numpy import int32,full,searchsorted
    s=searchsorted
    I=10**9+1
    n,q,*t=map(int,open(0).read().split())
    N0=2**(q-1).bit_length()
    data=full(2*N0,I,dtype='I')
    d=int32(t[-q:])
    t=int32(t[:-q])
    x=t[2::3]
    for x,l,r in sorted(zip(x,s(d,t[::3]-x)+N0,s(d,t[1::3]-x)+N0))[::-1]:
        while l<r:
            if r&1:
                r-=1
                data[r-1]=x
            if l&1:
                data[l-1]=x
                l+=1
            l>>=1
            r>>=1
    for k in range(N0-1,q+N0-1):
        s=I
        while~k:
            if data[k]<s:s=data[k]
            k=(k-1)//2
        print(s if s<I else-1)
if __name__=='__main__':
    main()

### FIXED CODE ###

def main():
    from bisect import bisect_left
    def update(l,r,v):
        L,R=l+N0,r+N0
        while L<R:
            if R&1:
                R-=1
                data[R-1]=v
            if L&1:
                data[L-1]=v
                L+=1
            L>>=1
            R>>=1
    def query(k):
        k+=N0-1
        s=10**18
        while k+1:
            if data[k]<s:s=data[k]
            k=~-k//2
        return s
    n,*t=open(0)
    n,q=map(int,n.split())
    d=[-10**18]+list(map(int,t[n:]))+[10**18]
    N0=2**(q+1).bit_length()
    data=[10**18]*2*N0
    for x,t,s in sorted(list(map(int,t.split()))[::-1]for t in t[:n])[::-1]:
        l=bisect_left(d,s-x)
        r=bisect_left(d,t-x)
        update(l,r,x)
    for i in range(q):
        a=query(i+1)
        print(-(a==10**18)or a)
if __name__=='__main__':
    main()
### BUGGY CODE ###

# -*- coding: utf-8 -*-
n = int(input())
sta = []

for i in range(n - 1):
    c, s, f = map(int, input().split())
    sta += [dict(c = c, s = s, f = f)]

for i in range(n):
    time = 0
    while i < n - 1:
        n_time = sta[i]['s']
        while time > n_time:
            n_time += sta[i]['f']
        time = n_time + sta[i]['c']
        i += 1
    print(str(time))

### FIXED CODE ###

# -*- coding: utf-8 -*-
import math

n = int(input())
sta = []

for i in range(n - 1):
    c, s, f = map(int, input().split())
    sta += [dict(c = c, s = s, f = f)]

for i in range(n):
    time = 0
    while i < n - 1:
        x = math.ceil((time - sta[i]['s']) / sta[i]['f']) if time > sta[i]['s'] else 0
        time = sta[i]['s'] + sta[i]['f'] * x + sta[i]['c']
        i += 1
    print(str(time))
### BUGGY CODE ###

n,p = map(int, input().split())
if n == 1:
  print(p)
  exit()
a = int(p**(1/n)+2)
for i in range(a,0,-1):
  if p%(i**n)==0:
    print(i)
    exit()

### FIXED CODE ###

n,p = map(int, input().split())
a = round(p**(1/n))
for i in range(a,-1,-1):
  if p%(i**n)==0:
    print(i)
    exit()
### BUGGY CODE ###

def gen(x):
    root = int(pow(x, 0.5))

    yield x

    for k in range(2, root):
        if x % k == 0:
            yield k
            yield x // k

    if x % root == 0:
        yield root
        if root != x // root:
            yield x // root


def main():
    N = int(input())

    # N%K!=0
    cnt = len(tuple(gen(N - 1)))

    # N%K==0
    for k in gen(N):
        x = N
        while x % k == 0:
            x //= k

        if x % k == 1:
            cnt += 1

    print(cnt)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def gen(x):
    root = int(pow(x, 0.5))
    for k in range(1, root + 1):
        if x % k == 0:
            yield k
            if k != x // k:
                yield x // k


def main():
    N = int(input())

    # N%K!=0
    cnt = sum(1 for _ in filter(lambda x: x > 1, gen(N - 1)))

    # N%K==0
    for k in filter(lambda x: x > 1, gen(N)):
        x = N
        while x % k == 0:
            x //= k

        if x % k == 1:
            cnt += 1

    print(cnt)


if __name__ == '__main__':
    main()
### BUGGY CODE ###

n,x,y=map(int,input().split())
x-=1
y-=1
a=[]
for i in range(n):
  a.append(0)
for i in range(n):
  for j in range(n):
    if i<j:
      p=min(abs(j-i),abs(x-i)+abs(y-j)+1,abs(y-i)+abs(x-j)+1)
      a[p]+=1
for i in range(n-1):
  print(str(a[i+1]))

### FIXED CODE ###

n,x,y=map(int,input().split())
x-=1
y-=1
a=[]
for i in range(n):
  a.append(0)
for i in range(n-1):
  for j in range(n-i):
    j=n-1-j
    p=min(abs(j-i),abs(x-i)+abs(y-j)+1,abs(y-i)+abs(x-j)+1)
    a[p]+=1
for i in range(n-1):
  print(str(a[i+1]))
### BUGGY CODE ###

n=int(input())
A=[int(i) for i in input().split()]
B=[0]*60
ans=0
mod=10**9+7
for i,a in enumerate(A):
  for j in range(60):
    if a%2==0:
      ans=(ans+B[j]*(2**j))%mod
    else:
      ans=(ans+(i-B[j])*(2**j))%mod
      B[j]+=1
    a//=2

print(ans)


### FIXED CODE ###

n=int(input())
A=[int(i) for i in input().split()]
B=[0]*60
C=[0]*60
ans=0
mod=10**9+7
for i,a in enumerate(A):
  for j in range(60):
    if a%2==0:
      C[j]+=B[j]
    else:
      C[j]+=i-B[j]
      B[j]+=1
    a//=2
for i in range(60):
  ans=(ans+C[i]*(pow(2,i,mod)))%mod
print(ans)
### BUGGY CODE ###

# -*- coding:utf-8 -*-

result = list()

def operation(command):
    if command[0] == "insert":
        result.insert(0, int(command[1]))
    elif command[0] == "delete":
        if int(command[1]) in result:
            result.remove(int(command[1]))
    elif command[0] == "deleteFirst":
        result.pop(0)
    elif command[0] == "deleteLast":
        result.pop()

n = int(input())
for i in range(n):
    command = input().split()
    operation(command)
print(*result)

### FIXED CODE ###

# -*- coding:utf-8 -*-

from collections import deque

result = deque()

def operation(command):
    if command[0] == "insert":
        result.appendleft(command[1])
    elif command[0] == "delete":
        if command[1] in result:
            result.remove(command[1])
    elif command[0] == "deleteFirst":
        result.popleft()
    elif command[0] == "deleteLast":
        result.pop()

n = int(input())
for i in range(n):
    command = input().split()
    operation(command)
print(*result)
### BUGGY CODE ###

import sys

def solve():
    input = sys.stdin.readline
    N, C = map(int, input().split())
    D = [[int(d) for d in input().split()] for _ in range(C)]
    col = [[int(i) - 1 for i in input().split()] for _ in range(N)]
    minD = 10 ** 20
    for i in range(C):
        for j in range(C):
            for k in range(C):
                if i != j and j != k and k != i:
                    this_D = 0
                    changed = [i, j, k]
                    for ni in range(N):
                        for nj in range(N):
                            if col[ni][nj] != changed[(ni + nj) % 3]:
                                this_D += D[col[ni][nj]][changed[(ni + nj) % 3]]
                    minD = min(minD, this_D)
    print(minD)

    return 0

if __name__ == "__main__":
    solve()

### FIXED CODE ###

from collections import defaultdict

N, C = map(int, input().split())
D = [[int(i) for i in input().split()] for c in range(C)]
Ini = [[int(i) for i in input().split()] for n in range(N)]
C0, C1, C2 = defaultdict(int), defaultdict(int), defaultdict(int)
D0, D1, D2 = [[0, d] for d in range(C)], [[0, d] for d in range(C)], [[0, d] for d in range(C)]
for i in range(N):
    for j in range(N):
        if (i+j+2)%3 == 0:
            C0[Ini[i][j] - 1] += 1
        elif (i+j+2)%3 == 1:
            C1[Ini[i][j] - 1] += 1
        else:
            C2[Ini[i][j] - 1] += 1

for i in range(C):
    for c in C0:
        D0[i][0] += D[c][i] * C0[c]
    for c in C1:
        D1[i][0] += D[c][i] * C1[c]
    for c in C2:
        D2[i][0] += D[c][i] * C2[c]

D0.sort()
D1.sort()
D2.sort()
Ans = float("inf")
for i in range(3):
    I = D0[i]
    for j in range(3):
        J = D1[j]
        for k in range(3):
            K = D2[k]
            if I[1] != J[1] and J[1] != K[1] and K[1] != I[1]:
                Ans = min(Ans, I[0] + J[0] + K[0])
print(Ans)
### BUGGY CODE ###



s = input()
q = int(input())



for i in range(q):
    inp = input()
    if inp[0] == "1":
        s = s[::-1]
    elif inp[2] == "1":
        s = inp[4] + s
    else:
        s = s + inp[4]


print(s)


### FIXED CODE ###

from collections import deque

#inp = list(map(lambda x: int(x), input().split()))
#n,k = map(lambda x: int(x), input().split())
#p_n = list(map(lambda x:int(x),input().split()))


s = deque(input())
q = int(input())


cnt = 0
for i in range(q):
    inp = input().split()
    if inp[0] == "1":
        cnt += 1
    else:
        if inp[1] == "1":
            if cnt % 2 == 0:
                s.appendleft(inp[2])
            else:
                s.append(inp[2])
        else:
            if cnt % 2 == 0:
                s.append(inp[2])
            else:
                s.appendleft(inp[2])

ans = list(s)

if cnt % 2 == 1:
    ans = ans[::-1]

print(''.join(ans))
### BUGGY CODE ###

N = int(input())

dct = {}

lst = [input() for _ in range(N)]

for i in range(N):
    if not lst[i] in dct:
        dct[lst[i]] = 1

    else:
        dct[lst[i]] +=  1
    
ans = []
for key in dct.keys():
    if dct[key] == max(dct.values()):
        ans.append(key)

for j in sorted(ans):
    print(j)

### FIXED CODE ###

N = int(input())

dct = {}

for i in range(N):
    s = input()
    if not s in dct:
        dct[s] = 1

    else:
        dct[s] +=  1
    
m = max(dct.values())
for s in sorted(k for k in dct if dct[k] == m):
    print(s)
### BUGGY CODE ###

from collections import deque
import sys
input=sys.stdin.readline

def cal():
    h, w = map(int, input().split())
    q = deque()
    counts = [[True for _ in range(w+2)]]+[[True]+[False for _ in range(w)]+[True] for _ in range(h)]+[[True for _ in range(w+2)]]
    loc = [(1, 0), (-1, 0), (0, 1), (0, -1)]
    for i in range(h):
        a = input()
        for j in range(w):
            if a[j] == '#':
                q.append([i+1, j+1, 0])
                counts[i+1][j+1] = True

    while len(q) > 0:
        x, y, z = q.popleft()
        for i, j in loc:
            x0 = x+i
            y0 = y+j
            if not counts[x0][y0]:
                counts[x0][y0] = True
                q.append([x0, y0, z+1])
    print(z)

cal()


### FIXED CODE ###

from collections import deque

def cal():
    h, w = map(int, input().split())
    q = deque()
    counts = [[True for _ in range(w+2)]]+[[True]+[False]*w+[True] for _ in range(h)]+[[True for _ in range(w+2)]]
    for i in range(h):
        a = input()
        for j in range(w):
            if a[j] == '#':
                q.append([i+1, j+1, 0])
                counts[i+1][j+1] = True

    while q:
        x, y, z = q.popleft()    
        if not counts[x+1][y]:
            counts[x+1][y] = True
            q.append([x+1, y, z+1])
        if not counts[x-1][y]:
            counts[x-1][y] = True
            q.append([x-1, y, z+1])
        if not counts[x][y+1]:
            counts[x][y+1] = True
            q.append([x, y+1, z+1])
        if not counts[x][y-1]:
            counts[x][y-1] = True
            q.append([x, y-1, z+1])
    print(z)
    

cal()
### BUGGY CODE ###

#!/usr/bin/env python3

import sys


def main():
    n, m, q = [int(x) for x in sys.stdin.readline().rstrip().split(' ')]

    cities_l = [[] for i in range(n+1)]
    cities_r = [[] for i in range(n+1)]
    cities_qp = [[] for i in range(n+1)]
    cities_qq = [[] for i in range(n+1)]

    for i in range(m):
        l, r = [int(x) for x in sys.stdin.readline().rstrip().split(' ')]
        cities_l[l].append(i)
        cities_r[r].append(i)

    for i in range(q):
        qp, qq = [int(x) for x in sys.stdin.readline().rstrip().split(' ')]
        cities_qp[qp].append(i)
        cities_qq[qq].append(i)

    z = set()
    ans = [[[], []] for i in range(q)]
    for i in range(1,n+1):
        z |= set(cities_qp[i])
        for j in z:
            ans[j][0] += cities_l[i]
            ans[j][1] += cities_r[i]
        z -= set(cities_qq[i])

    for i in range(q):
        print(len(set(ans[i][0]) & set(ans[i][1])))

if __name__=='__main__':
    main()

### FIXED CODE ###

#!/usr/bin/env python3

import sys


def main():
    n, m, q = [int(x) for x in sys.stdin.readline().rstrip().split(' ')]

    x = [[0 for j in range(n+1)] for i in range(n+1)]
    c = [[0 for j in range(n+1)] for i in range(n+1)]
    z = [[0 for j in range(n+1)] for i in range(n+1)]

    for i in range(m):
        l, r = [int(x) for x in sys.stdin.readline().rstrip().split(' ')]
        x[l][r] += 1
    
    for i in range(1, n+1):
        for j in range(1, n+1):
            c[i][j] = c[i][j-1] + x[i][j]

    for j in range(1, n+1):
        for i in range(1, n+1):
            z[i][j] = z[i-1][j] + c[i][j]
    
    for i in range(q):
        qp, qq = [int(x) for x in sys.stdin.readline().rstrip().split(' ')]
        print(z[qq][qq] - z[qq][qp-1] - z[qp-1][qq] + z[qp-1][qp-1])


if __name__=='__main__':
    main()
### BUGGY CODE ###

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

max_bef = 0
cnt = 0

for i in range(1,N):
    tmp = A[i] - min(A[:i])
    if max_bef < tmp:
        max_bef = tmp
        cnt = 0
    if max_bef == tmp:
        cnt += 1

print(cnt)


### FIXED CODE ###

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

max_bef = 0
cnt = 0
A_min = A[0]

for i in range(1,N):
    tmp = A[i] - A_min
    if max_bef < tmp:
        max_bef = tmp
        cnt = 0
    if max_bef == tmp:
        cnt += 1
    A_min = min(A_min, A[i])

print(cnt)
### BUGGY CODE ###

from collections import deque
n = int(input())
l = deque()

for i in range(n):
    cmd = input().split()
    if cmd[0] == 'insert':
        l.append(cmd[1])
    if cmd[0] == 'find':
        if l.count(cmd[1]) == 0:
         print('no')
        else:
         print('yes')

### FIXED CODE ###

from collections import defaultdict

d = defaultdict(lambda: 0)

N = int(input())

for _ in range(N):
    ord, str = input().split()
    if ord == 'insert':
        d[str] = 1
    else:
        if str in d:
            print('yes')
        else:
            print('no')
### BUGGY CODE ###

N,M = (int(i) for i in input().split()) 
a = [int(input()) for i in range(M)] 

mod=10**9+7

dp=[0]*(N+1)

dp[0]=1
if 1 in a:
	dp[1]=0
else:
	dp[1]=1

for i in range(0, N-1):
	if i+2 in a:
		dp[i+2]=0
	else:
		dp[i+2]+=dp[i+1]+dp[i]
	
print(dp[N]%mod)

### FIXED CODE ###

N,M = (int(i) for i in input().split()) 
a = set(int(input()) for i in range(M))

mod=10**9+7

dp=[0]*(N+1)

dp[0]=1
if 1 in a:
	dp[1]=0
else:
	dp[1]=1

for i in range(0, N-1):
	if i+2 in a:
		dp[i+2]=0
	else:
		dp[i+2]+=dp[i+1]+dp[i]
	
print(dp[N]%mod)
### BUGGY CODE ###

import sys

sys.setrecursionlimit(200000)

def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()
S=one_str()

bit_count = S.count("1")
S_min = int(S,2) % (bit_count-1) if bit_count-1!=0 else 0
S_plu = int(S,2) % (bit_count+1)
S_num = int(S,2)



# calc_dict = {i:-1 for i in range(100000)}
# res_dict =  {i:-1 for i in range(2*(10**5))}

# for i in range(1, 100000):
#     if calc_dict[i]==-1:
#         calc_dict[i] = bin(i).count("1")

#     res_dict[i] = i%calc_dict[i]+1

def mods(temp, count):
    count+=1
    if temp!=0:

#         if temp in res_dict:
#             print(count, temp, res_dict[temp])
#             print("come")
#             print()
#             return count+res_dict[temp]
        
#         if calc_dict[temp]==-1:
        bits = bin(temp).count("1")            
        count = mods(temp%bits, count)

    return count

for i in range(N):
    if S[i]=="0":
        part = (2**(N-i-1))% (bit_count+1)
        num = (S_plu + part ) % (bit_count+1)
        print(mods(num, 0))
    else:
        if S_num == 2**(N-i-1):
            print(0)
            continue
        part = (2**(N-i-1))% (bit_count-1)
        num = (S_min - part)%(bit_count-1)
        print(mods(num, 0))




### FIXED CODE ###

def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))

N=one_int()
S=one_str()

bit_count = S.count("1")
S_num = int(S,2)
S_min = S_num % (bit_count-1) if bit_count-1!=0 else 0
S_plu = S_num % (bit_count+1)




# calc_dict = {i:-1 for i in range(10000)}
# res_dict =  {i:-1 for i in range(10**4)}

# for i in range(1, 10000):
#     if calc_dict[i]==-1:
#         calc_dict[i] = bin(i).count("1")

#     res_dict[i] = i%calc_dict[i]+1

def mods(temp, count):
    count+=1
    if temp!=0:

#         if temp in res_dict:
#             return count+res_dict[temp]
        
#         if temp not in calc_dict:
#             calc_dict[temp]= bin(temp).count("1") 
        count = mods(temp%bin(temp).count("1") , count)

    return count

for i in range(N):
    if S[i]=="0":
        part = pow(2, (N-i-1), bit_count+1)
        num = (S_plu + part ) % (bit_count+1)
        print(mods(num, 0))
    else:
        if S_num == 2**(N-i-1):
            print(0)
            continue
        part = pow(2, (N-i-1), bit_count-1)
        num = (S_min - part)%(bit_count-1)
        print(mods(num, 0))
### BUGGY CODE ###

import numpy as np
n=int(input())
a=list(map(int,input().split()))
ans=1
for i in range(n):
    ans=ans*a[i]
if ans>10**18:
    anscheck=False
else:
    anscheck=True
print(ans if anscheck else -1)

### FIXED CODE ###

import numpy as np
n=int(input())
a=list(map(int,input().split()))
ans=1
if 0 in a:
    print(0)
    exit()
for i in range(n):
    ans=ans*a[i]
    if ans>10**18 and not 0 in a:
      print(-1)
      exit()
if ans>10**18:
    anscheck=False
else:
    anscheck=True
print(ans if anscheck else -1)
### BUGGY CODE ###

K = int(input())

import fractions

res = 0


for i in range(1, K+1):
    for j in range(1, K+1):
        for l in range(1, K+1):
            a = list([i, j, l])
            ans = a[0]
            for n in range(1, 3):
                ans = fractions.gcd(ans, a[n])
            res += ans

print(res)


### FIXED CODE ###

import math

K = int(input())

ans = 0

for i in range(1,K+1):
    for j in range(1,K+1):
        t = math.gcd(i, j)
        for k in range(1,K+1):
            ans += math.gcd(t, k)

print(ans)
### BUGGY CODE ###

N = int(input())
i = 0
while True:
    i += 1
    if N*i % 360 == 0:
        print(i)

### FIXED CODE ###

N = int(input())
i = 0
while True:
    i += 1
    if N*i % 360 == 0:
        print(i)
        break
### BUGGY CODE ###

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

ans = 0
for b in B:
    a_ = len(list(filter(lambda x:x < b, A)))
    c_ = len(list(filter(lambda x:x > b, C)))
    ans += a_ * c_

print(ans)


### FIXED CODE ###

import bisect

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

ans = 0
for b in B:
    a_num = bisect.bisect_left(A, b)
    c_num = N - bisect.bisect_right(C, b)
    ans += a_num * c_num

print(ans)