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

n = int(input())
ls = list(map(int, input().split()))
i = 0
while i < n:
    if ls.count(ls[i]) == 1:
        i += 1
    else:
        print("NO")
        break

if i == n:
    print("YES")

    


### FIXED CODE ###

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

def merge_sort(arr):
    if len(arr) <= 1:
        return arr

    mid = len(arr) // 2
    # ここで分割を行う
    left = arr[:mid]
    right = arr[mid:]

    # 再帰的に分割を行う
    left = merge_sort(left)
    right = merge_sort(right)

    # returnが返ってきたら、結合を行い、結合したものを次に渡す
    return merge(left, right)


def merge(left, right):
    merged = []
    l_i, r_i = 0, 0

    # ソート済み配列をマージするため、それぞれ左から見ていくだけで良い
    while l_i < len(left) and r_i < len(right):
        # ここで=をつけることで安定性を保っている
        if left[l_i] <= right[r_i]:
            merged.append(left[l_i])
            l_i += 1
        else:
            merged.append(right[r_i])
            r_i += 1

    # 上のwhile文のどちらかがFalseになった場合終了するため、あまりをextendする
    if l_i < len(left):
        merged.extend(left[l_i:])
    if r_i < len(right):
        merged.extend(right[r_i:])
    return merged

a = merge_sort(ls)
i = 0
while i < n-1:
    if a[i] == a[i+1]:
        print("NO")
        break
    else:
        i += 1

if i == n-1:
    print("YES")
### BUGGY CODE ###

n,m=map(int,input().split())
a=[list(map(int,input().split())) for i in range(m)]
ikeruheya = [[] for i in range(n)]
ans = [0]*(n+1)
#check = [0]*n
#check[0]=1
ans[0]=-1
ans[1]=1
for i in range(m):
    ikeruheya[a[i][0]-1].append(a[i][1])
    ikeruheya[a[i][1]-1].append(a[i][0])

    
next=[1]
count = 1
while len(next) != 0 and count <= n:
    imaheya = next.pop(0)
    for j in range(len(ikeruheya[imaheya-1])):
        
        if ans[ikeruheya[imaheya-1][j]]==0:
            ans[ikeruheya[imaheya-1][j]]= imaheya 
            #check[ikeruheya[imaheya-1][j]-1] = 1
            next.append(ikeruheya[imaheya-1][j])
            count += 1
            
print("Yes")
for i in range(2, n+1):
    print(ans[i])


    
    


### FIXED CODE ###

from collections import deque
n,m = map(int,input().split())
a=[list(map(int, input().split())) for i in range(m)]
b=[[] for j in range(n)] 

michi=[-1]*(n)
michi[0]=0
heya=[]


for i in range(m):
    b[a[i][0]-1].append(a[i][1])
    b[a[i][1]-1].append(a[i][0])



heya.append(1)


while len(heya):
    now=heya.pop(0)-1
    
    for i in range(len(b[now])):
        if michi[b[now][i]-1] == -1:
            heya.append(b[now][i])
            michi[b[now][i]-1] = now+1
print("Yes")
for i in range(1,n):
    print(michi[i])
### BUGGY CODE ###

# ABC-142-D
A, B = map(int, input().split())
ans = 1

#最大公約数
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def get_prime_number(x):
    if x == 1:
        return []
    max = int(x ** 0.5)
    search_list = [i for i in range(2,x+1)]
    prime_num = []
    while search_list[0] <= max:
        prime_num.append(search_list[0])
        tmp = search_list[0]
        search_list = [i for i in search_list if i % tmp != 0]
    prime_num.extend(search_list)
    return prime_num

#xの素因数を全て出す
def get_prime_factor(x):
    search_list = get_prime_number(x)
    prime_factor_list = []
    for i in search_list:
        if x % i == 0:
            prime_factor_list.append(i)
    return prime_factor_list

gcd_AB = gcd(A, B)
prime = get_prime_factor(gcd_AB)
ans += len(prime)
print(ans)

### FIXED CODE ###

from fractions import gcd
def f(n):
    tmp = n
    cnt = 0
    i = 2
    while i <= n**0.5 + 1:
        if tmp < i:
            break
        if tmp % i == 0:
            cnt += 1
            while tmp % i == 0:
                tmp //= i
        i += 1
    if tmp != 1:
        cnt += 1
    return cnt

A, B = map(int, input().split())
g = gcd(A, B)
ans = f(g) + 1
print(ans)
### BUGGY CODE ###

n = int(input())
i = 1
ret = ""
while True:
    x = i
    if  x % 3 == 0:
        ret += " " + str(i)
    elif x % 10 == 3:
        ret += " " + str(i)
    else:
        x /= 10
        while x > 0:
            if x % 10 == 3:
                ret += " " + str(i)
                x /= 10
    i+=1
    if i > n:
        break

print(ret)



### FIXED CODE ###

#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


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

import sys
input = sys.stdin.readline

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

A.append(1)

def test(x):
    digit = [0]
    cnt = [0]
    for a in A:
        if digit[-1] < a:
            digit.append(a)
            cnt.append(1)
            continue
        if digit[-1] == a:
            cnt[-1] += 1
            continue
        while True:
            # 繰り上がり処理をしながら左に戻る
            n = digit[-1]
            k = cnt[-1]
            if n <= a:
                break
            digit.pop()
            cnt.pop()
            if k <= x:
                continue
            if digit[-1] == n-1:
                cnt[-1] += (k-1)//x
            else:
                digit.append(n-1)
                cnt.append((k-1)//x + 1)
        if digit[-1] == a:
            cnt[-1] += 1
        else:
            digit.append(a)
            cnt.append(2)
    return cnt[1] <= x+1

if all(x<y for x,y in zip(A[:-2],A[1:-1])):
    print(1)
    exit()

left = 1 # 無理
right = 2 # 可能？
while not test(right):
    left = right
    right *= 2
while right > left + 1:
    mid = (left+right)//2
    if test(mid):
        right = mid
    else:
        left = mid

answer = right
print(answer)

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

A.append(1)

def test(x):
    digit = [0]
    cnt = [0]
    for a in A:
        if digit[-1] < a:
            digit.append(a)
            cnt.append(1)
            continue
        if digit[-1] == a:
            cnt[-1] += 1
            continue
        while True:
            # 繰り上がり処理をしながら左に戻る
            if digit[-1] <= a:
                break
            n = digit.pop()
            k = cnt.pop()
            if k <= x:
                continue
            if digit[-1] == n-1:
                cnt[-1] += (k-1)//x
            else:
                digit.append(n-1)
                cnt.append((k-1)//x + 1)
        if digit[-1] == a:
            cnt[-1] += 1
        else:
            digit.append(a)
            cnt.append(2)
    return cnt[1] <= x+1

if all(x<y for x,y in zip(A[:-2],A[1:-1])):
    print(1)
    exit()

left = 1 # 無理
right = N # 可能
while right > left + 1:
    mid = (left+right)//2
    if test(mid):
        right = mid
    else:
        left = mid

answer = right
print(answer)
### BUGGY CODE ###

n,p=map(int,input().split())
s=input().rstrip()
ans=0
l=[0]*p
 
if p==2 or p==5:
    for i in range(n):
        if int(s[i])%p==0:
            ans+=i+1
 
else:
    for i in range(n):
        mod=int(s[-(i+1):])%p
        ans+=l[mod]
        l[mod]+=1
        if mod==0:
            ans+=1
 
print(ans)

### FIXED CODE ###

n,p=map(int,input().split())
s=input().rstrip()
ans=0
l=[0]*p
a=[0,1,2,3,4,5,6,7,8,9]
c=0

if p==2 or p==5:
    for i in range(n):
        if int(s[i])%p==0:
            ans+=i+1
else:
    for i in range(n):
        # mod=int(s[-(i+1):])%p
        mod=(c+a[int(s[-(i+1)])])%p
        ans+=l[mod]
        l[mod]+=1
        if mod==0:
            ans+=1
        c=mod
        
        for j in range(10):
            a[j]=a[j]*10%p
 
print(ans)
### BUGGY CODE ###

import math
import collections
import sys

input = sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]

n=I()
s=input()
r=[]
g=[]
t=[]
for i in range(n):
    if s[i:i+1]=="R":
        r.append(i)
    elif s[i:i+1]=="G":
        g.append(i)
    elif s[i:i+1]=="B":
        t.append(i)
#print(r)
#print(g)
#print(t)
ans=len(r)*len(g)*len(t)
for a in r:
    for b in g:
        if 2*b-a in t:
            ans-=1
        if 2*a-b in t:
            ans-=1
        if (a+b)%2==0 and (a+b)//2 in t:
            ans-=1
print(ans)

### FIXED CODE ###

import math
import collections
import sys

input = sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]

n=I()
s=input()
r=[]
g=[]
t=[]
for i in range(n):
    if s[i:i+1]=="R":
        r.append(i)
    elif s[i:i+1]=="G":
        g.append(i)
    else:
        t.append(i)
R=len(r)
G=len(g)
T=n-R-G
ans=R*G*T
for i in range(n-1):
    for j in range(i+1,n):
        if s[i]!=s[j]:
            if j<2*i-j<=n-1:
                if s[i]!=s[2*i-j] and s[j]!=s[2*i-j]:
                    ans-=1
            if j<2*j-i<=n-1:
                if s[i]!=s[2*j-i] and s[j]!=s[2*j-i]:
                    ans-=1
            if (i+j)%2==0 and j<(i+j)//2 and s[i]!=s[(i+j)//2] and s[j]!=s[(i+j)//2]:
                ans-=1
print(ans)
### BUGGY CODE ###

def solve():
    while 1:
        try:
            N, M = list(map(int, input().split(" ")))
            graph = [[None] * N for _ in range(N)]
            for _ in range(M):
                a, b = list(map(int, input().split(" ")))
                graph[a - 1][b - 1], graph[b - 1][a - 1] = 1, 1

            edges_from1 = graph[0].count(1)
            edges_fromN = graph[N - 1].count(1)
            if not edges_from1 or not edges_fromN:
                print("IMPOSSIBLE")
                break

            if edges_fromN < edges_from1:
                start_node = N - 1
                goal_node = 0
            else:
                start_node = 0
                goal_node = N - 1

            for j in range(N):
                if graph[start_node][j] == 1:
                    if graph[j][goal_node] == 1:
                        print("POSSIBLE")
                        raise EndLoop

            print("IMPOSSIBLE")
        except:
            break


solve()

### FIXED CODE ###

#!/usr/bin/python
# -*- coding: utf-8 -*-
from collections import deque


class EndLoop(Exception):
    pass


def solve():
    while 1:
        try:
            N, M = list(map(int, input().split(" ")))
            Deque1 = deque()
            DequeN = deque()
            edges_1 = [False] * N
            edges_N = [False] * N
            Deque1.extend(edges_1)
            DequeN.extend(edges_N)

            for _ in range(M):
                a, b = list(map(int, input().split(" ")))
                if a == 1:
                    Deque1[b - 1] = True
                elif b == 1:
                    Deque1[a - 1] = True
                elif a == N:
                    DequeN[b - 1] = True
                elif b == N:
                    DequeN[a - 1] = True
                else:
                    pass

            for i in range(N):
                if Deque1[i] == True and DequeN[i] == True:
                    print("POSSIBLE")
                    raise EndLoop

            print("IMPOSSIBLE")
            break
        except:
            break


solve()
### BUGGY CODE ###

from itertools import combinations

N = int(input())
S = input()
answer = 0

for i, j in combinations(range(N), 2):
    limit = j
    if j - i == 1:
        if answer > N - j:
            break
    cnt = 0
    while S[i] == S[j]:
        cnt += 1
        i += 1
        j += 1
        if j > N - 1 or i == limit:
            break
    if answer < cnt:
        answer = cnt

print(answer)

### FIXED CODE ###

def z_algorithm(S):
    n = len(S)
    A = [0] * n
    A[0] = n
    L = 0
    R = 0
    # 過去にS[R]まで調べたとする
    for i in range(1, n):
        if R <= i:
            L = R = i
            while R < n and S[R] == S[R - L]:
                R += 1
            A[i] = R - L
        elif A[i - L] < R - i:
            A[i] = A[i - L]
        else:
            L = i
            while R < n and S[R] == S[R - L]:
                R += 1
            A[i] = R - L
    return A


def main():
    N = int(input())
    S = input()
    answer = 0
    for i in range(N):
        a = z_algorithm(S[i:])
        for j in range(1, N - i):
            cnt = min(j, a[j])
            if cnt > answer:
                answer = cnt

    print(answer)


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

from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heappop,heappush
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n, m = MAP()
a = sorted(LIST(), reverse=True)
b = [LIST() for i in range(m)]
b.sort(key=itemgetter(1), reverse=True)

c = []
for i in range(m):
    c += [b[i][1]]*b[i][0]

a += c
a.sort(reverse=True)
print(sum(a[:n]))

### FIXED CODE ###

from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heappop,heappush
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n, m = MAP()
aa = Counter(LIST())
aa = sorted(aa.items(), key=itemgetter(0))
a = [[aa[i][1], aa[i][0]] for i in range(len(aa))]
b = sorted([LIST() for i in range(m)], key=itemgetter(1), reverse=True)

ans = 0
i = j = 0
while i < len(b) and j < len(a) and b[i][1] > a[j][1]:
    if b[i][0] >= a[j][0]:
        ans += b[i][1]*a[j][0]
        b[i][0] -= a[j][0]
        a[j][0] = 0
        j += 1
    else:
        ans += b[i][1]*b[i][0]
        a[j][0] -= b[i][0]
        b[i][0] = 0
        i += 1
reg = j
if reg < len(a):
    for i in range(j, len(a)):
        ans += a[i][0]*a[i][1]
print(ans)
### BUGGY CODE ###

import math
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

MOD = 10 ** 9 + 7

N = I()
A = LI()
ans = 0

for i in range(N-1):
    for j in range(i+1,N):
        ans = (ans + A[i]*A[j]) % MOD
       
print(ans%MOD)

### FIXED CODE ###

import math
import sys
import os
from operator import mul
import numpy as np

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")

MOD = 10 ** 9 + 7

N = I()
A = LI()
ans = 0

# A = np.array(A)
sum = [0]*(N+1)
for i in range(N):
        sum[i+1] = sum[i]+A[i]

for i in range(N-1):
    ans += A[i] * (sum[N] - sum[i+1]) % MOD

       
print(ans%MOD)
### BUGGY CODE ###

def main():
    n = int(input())
    h = list(map(int, input().split()))
    ans = 0
    for i in range(n - 1):
        j = i
        count = 0
        while j < n-1:
            # print(h[j])
            # print(h[j + 1])
            # print("=====")
            if h[j] >= h[j + 1]:
                count += 1
                j += 1
                ans = max(ans, count)
            else:
                # ans = max(ans, count)
                break
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    n = int(input())
    h = list(map(int, input().split()))
    ans = 0
    max_list = [0]
    for i in range(n - 1):
        if h[i] >= h[i + 1]:
            ans += 1
            max_list.append(ans)
        else:
            ans = 0
    print(max(max_list))


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

H, W = map(int, input().split())
a = []
INF = 10 ** 9
for i in range(H):
    a.append(input())

# 黒マスの位置を記録
stack = []
black_map = [[ a[i][j] == "#" for j in range(W)] for i in range(H)]
for i in range(H):
    for j in range(W):
        if a[i][j] == "#":
            stack.append([i, j])

cnt = 0
while True:
    _stack = []
    for pos in stack:
        for i in [[-1,0], [1, 0], [0, -1], [0, 1]]:
            _x = pos[0] + i[0]
            _y = pos[1] + i[1]
            if 0 <= _x <= H-1 and 0 <= _y <= W-1 and not black_map[_x][_y]:
                _stack.append([_x, _y])
                black_map[_x][_y] = True
    if len(_stack) > 0:
        stack = _stack[::]
    else:
        break
    cnt += 1
print(cnt)

### FIXED CODE ###

from collections import deque
h,w = list(map(int,input().split()))
f = []
q = deque()
for i in range(h):
    a = list(input())
    for j in range(w):
        if a[j] == '#':
            q.append([0,i,j])
    f.append(a)
 
ans =0
dxy = [0,1,0,-1,0]
while(len(q)):
    c,y,x = q.popleft()
    for i in range(4):
        ny = y+dxy[i]
        nx = x+dxy[i+1]
        if nx >= w or ny >= h or nx <0 or ny <0:
            continue
        if f[ny][nx] == '.':
            f[ny][nx] = c+1
            q.append([c+1,ny,nx])
            ans = max(ans,c+1)
        elif f[ny][nx] != '#' and f[ny][nx] > c+1:
            f[ny][nx] = c+1
            q.append([c+1,ny,nx])
            ans = max(ans,c+1)
 
print(ans)
### BUGGY CODE ###

N = int(input())
ans = 0
for i in range(1, (N+1)//2):
    for j in range((N+1)//2, N+1):
        if (i + j) > N:
            break
        elif (i + j) == N:
            ans += 1
            break

print(ans)

### FIXED CODE ###

N = int(input())
if N % 2 == 1:
    N += 1
ans = (N/2)-1
print(int(ans))
### BUGGY CODE ###

import math
num_limit = int(input())
s_limit_1 = int(num_limit**0.5)
s_limit_2 = int((num_limit/2)**0.5)
s_limit_3 = int((num_limit/3)**0.5)
for i in range(1,num_limit+1):
    xyz_list = []
    xyz_count = 0
    s_limit_1 = int(i ** 0.5)
    for j in range(1,s_limit_1+1):
        for k in range(1,j+1):
            for l in range(1,k+1):
                if i == j**2 + k**2 + l**2 + j*k + k*l + l*j:
                    if j == k and k == l:
                        xyz_count += 1
                    elif j == k and k > l or j > k and k == l:
                        xyz_count += 3
                    else:
                        xyz_count += 6
    print(xyz_count)

### FIXED CODE ###

num_limit = int(input())
num_list = [0] * num_limit
j_limit = int(num_limit ** 0.5)
for j in range(1,j_limit+1):
    for k in range(1,j + 1):
        for l in range(1,k+1):
            if num_limit >= j**2 + k**2 + l**2 + j*k + k*l + l*j:
                if j > k:
                    if k > l:
                        num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 6
                    else:
                        num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 3
                elif k > l:
                    num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 3
                else:
                    num_list[j**2 + k**2 + l**2 + j*k + k*l + l*j-1] += 1
for i in num_list:
    print(i)
### BUGGY CODE ###

import sys
import heapq
from collections import deque
sys.setrecursionlimit(10 ** 8)

H, W, K = map(int, sys.stdin.readline().strip().split())
xs, ys, xg, yg = map(int, sys.stdin.readline().strip().split())

m = []
for _ in range(H):
    m.append(list(map(str, sys.stdin.readline().strip())))

M = [[float('inf')] * W for _ in range(H)]


def bfs(x1, y1, d):
    q = deque()
    # heapq.heapify(q)
    # heapq.heappush(q, (d, (x1, y1)))
    q.append((d, (x1, y1)))

    while q:
        # d, u = heapq.heappop(q)
        d, u = q.popleft()
        x1 = u[0]
        y1 = u[1]

        M[x1][y1] = d

        if (x1 == xg - 1) and (y1 == yg - 1):
            break

        for dx, dy in [[0, 1], [1, 0], [0, -1], [-1, 0]]:
            k = 1
            while k <= K:
                x2 = x1 + dx * k
                y2 = y1 + dy * k
                if x2 < 0 or x2 >= H:
                    break
                if y2 < 0 or y2 >= W:
                    break
                if m[x2][y2] == '@':
                    break
                if M[x2][y2] != float('inf'):
                    break

                # heapq.heappush(q, (d + 1, (x2, y2)))
                q.append((d + 1, (x2, y2)))

                k += 1


if m[xs - 1][ys - 1] != '@':
    bfs(xs - 1, ys - 1, 0)

# for i in range(len(M)):
#     print(M[i])


ans = M[xg - 1][yg - 1]
if ans == float('inf'):
    print(-1)
else:
    print(ans)


### FIXED CODE ###

from collections import deque


def bfs(maze, visited, sy, sx, gy, gx):
    queue = deque([[sy, sx]])
    visited[sy][sx] = 0
    while queue:
        # queueには訪れた地点が入っている。そこから、4方向に移動できるか考え、queueから消す。
        y, x = queue.popleft()  # queueに入っていたものを消す。
        if [y, x] == [gy, gx]:  # もしゴールについていたならば、そのときの手数を出す。
            return visited[y][x]
        for j, k in ([1, 0], [-1, 0], [0, 1], [0, -1]):
            l = 1
            while True:
                new_y, new_x = y + j * l, x + k * l
                if (0 <= new_y < H) and (0 <= new_x < W):
                    if maze[new_y][new_x] == "@":
                        break
                    elif visited[new_y][new_x] == -1:  # まだ来たことない点だったという条件
                        visited[new_y][new_x] = visited[y][x] + 1
                        queue.append([new_y, new_x])  # 新しい点を足す。
                    elif visited[new_y][new_x] < visited[y][x] + 1:
                        break
                else:
                    break
                l += 1
                if l == K + 1:
                    break


H, W, K = map(int, input().split())
# K = min(K, max(H, W))
x1, y1, x2, y2 = map(int, input().split())
x1, y1, x2, y2 = x1 - 1, y1 - 1, x2 - 1, y2 - 1
C = [0] * H
for i in range(H):
    C[i] = str(input())
visited = [[-1] * W for i in range(H)]
bfs(C, visited, x1, y1, x2, y2)
# print(visited)
print(visited[x2][y2])
### BUGGY CODE ###

n = int(input())
a = [int(x) for x in input().split()]
a.sort()
ans = 1

for i in a:
    ans *= i

if ans <= 10 ** 18:
    print(ans)
else:
    print(-1)

### FIXED CODE ###

n = int(input())
a = [int(x) for x in input().split()]
a.sort()
ans = 1

for i in a:
    ans *= i
    if ans > 10 ** 18:
        print(-1)
        break
else:
    print(ans)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
ans = 0
K = int(input())
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            d = gcd(a,b)
            e = gcd(d,c)
            ans += e
print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

memo = [[[0]*201 for _ in range(201)] for _ in range(201)]
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

def t_gcd(a,b,c):
    d = gcd(a,b)
    e = gcd(c,d)
    res = gcd(d,e)
    memo[a][b][c] = res
    memo[a][c][b] = res
    memo[b][a][c] = res
    memo[b][c][a] = res
    memo[c][b][a] = res
    memo[c][a][b] = res
    return res
ans = 0
K = int(input())
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            if memo[a][b][c] == 0:
                ans += t_gcd(a,b,c)
            else:
                ans += memo[a][b][c]
print(ans)