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

N=int(input())

import sys

for h in range(1,3501):
    for n in range(h,3501):
        a=(h*n*N)
        b=(4*h*n-(n+h)*N)
        if b==0:
            continue

        w=a/b
        #w=int(w)

        #if w<h:
        #    break

        #print(n,w)
        if a%b==0:
            if N*(n*w+h*w+h*n)!=4*n*w*h:
                continue
            #print(w)
            if w>0:
                w=int(w)
                print(h,n,w)
                '''

                print(4/N)
                print(1/h+1/n+1/w)
                print(a,b)
                print(a/b)
                '''
                sys.exit()


### FIXED CODE ###

N=int(input())

import sys

for h in range(1,3501):
    for n in range(h,3501):
        a=(h*n*N)
        b=(4*h*n-(n+h)*N)
        if b==0:
            continue

        
        #w=int(w)

        #if w<h:
        #    break

        #print(h,n,w)
        #print(a,b)
        if a%b==0:
            w = a/b
            if N*(n*w+h*w+h*n)!=4*n*w*h:
                continue
            #print(w)
            if w>0:
                w=int(w)
                print(h,n,w)
                '''

                print(4/N)
                print(1/h+1/n+1/w)
                print(a,b)
                print(a/b)
                '''
                sys.exit()
### BUGGY CODE ###

import bisect

n, m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]

a.sort()

for i in range(m):
    div_a = a.pop(-1)
    div_a = div_a // 2
    insert_index = bisect.bisect_left(a, div_a)
    a.insert(insert_index, div_a)

ans = sum(a)
print(ans)


### FIXED CODE ###

import bisect

n, m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]


while m > 0:
    a.sort()
    m -= 1
    a[-1] = a[-1] // 2
    for i in range(n-1)[::-1]:
        if m == 0:
            break
        if a[i] > a[-1]:
            m -= 1
            a[i] = a[i] // 2
        else:
            break

ans = sum(a)
print(ans)
### BUGGY CODE ###

N = int(input())
a=[]
for i in range(N):
  a.append(input())
  
for j in range(N):
  modori=a.pop(j)
  print(max(a))
  a.insert(j,modori)
  


### FIXED CODE ###

N = int(input())
a=[]
for i in range(N):
  a.append(int(input()))

a1=max(a)
b=sorted(a)
a2=b[N-2]

for j in range(N):
  if a[j] != a1:
    print(a1)
  else:
    print(a2)
### BUGGY CODE ###

import math

N = int(input())
upper = int(math.sqrt(N))
#print(upper)

for n in range(1,N+1):
    myans = 0
    for x in range(1, upper):
        remain = n - x**2
        if remain >= 1:
            y_upper = int(math.sqrt(remain))
            for y in range(1, y_upper):
                if x**2 + y**2 + x*y < n:
                    for z in range(1, upper):
                        if x**2 + y**2 + z**2 + x*y + y*z + z*x == n:
                    #print(x,y,z,x**2 + y**2 + z**2 + x*y + y*z + z*x)
                            myans += 1
    print(myans)

### FIXED CODE ###


N = int(input())
myans = [ 0 for n in range(N+1)]
upper = int(N**(2/3))
#print(upper)
for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v < N+1:
                myans[v] += 1
#print(myans)
for a,b in enumerate(myans):
    if a != 0:
        print(b)
### BUGGY CODE ###

import heapq
def SME(start,end):
    A = []
    if end > N : end = N
    count = 0
    count2 = 0
    for i,x in enumerate(Whole[start:end]):
        heapq.heappush(A,[x,i])
    for j in range(start,end):
        a = heapq.heappop(A)
        tmp = count
        for i in range(L):
            idx = a[1] + i
            try :
                if ANS[idx] : continue
                else :
                    ANS[idx] = a[0]
                    count += 1
            except IndexError : continue
        if count == tmp : count2 += 1
        if count2 > 300 : break
    for i in range(L):
        if ANS[i] : continue
        else : ANS[i] = min(Whole[:i+1])
    for i in range(L,N):
        if ANS[i] : continue
        else : ANS[i] = min(Whole[i+1-L:i+1])
    return ANS

[N,L] = [int(x) for x in input().split()]
Whole = [int(x) for x in input().split()]
parameter = 0.97
ANS = [None]*N
ANS = SME(0, N)
for i in ANS[L-1:-1]:print(i, end=" ")
print(ANS[-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
### BUGGY CODE ###

import sys
sys.setrecursionlimit(2147483647)
input = sys.stdin.readline

if __name__ == '__main__':
  n,m,k=map(int,input().strip("\n").split())
  A=list(map(int,input().strip("\n").split()))
  B=list(map(int,input().strip("\n").split()))
#  A.append(10**9+1)
#  B.append(10**9+1)

  def dfs(a,b,k,s):
    if k<0:
      return s-1
    if k==0:
      return s
    if a<n:
      ansA=dfs(a+1,b,k-A[a],s+1)
    else:
      ansA=s

    if b<m:
      ansB=dfs(a,b+1,k-B[b],s+1)
    else:
      ansB=s
    return max(ansA,ansB)

  ans=max(dfs(1,0,k-A[0],1),dfs(0,1,k-B[0],1))
  print(ans)


### FIXED CODE ###

import sys
from collections import deque
import copy
sys.setrecursionlimit(2147483647)
input = sys.stdin.readline

if __name__ == '__main__':
  n,m,k=map(int,input().strip("\n").split())
  A=list(map(int,input().strip("\n").split()))
  B=list(map(int,input().strip("\n").split()))
  t=sum(B)
  j=m
  ans=0
  for i in range(n+1):
    while j>0 and t>k:
      j-=1
      t-=B[j]
    if t>k:
      break
    ans=max(ans,i+j)
    if i==n:
      break
    t+=A[i]
  print(ans)
### BUGGY CODE ###

N = int(input())
count = 0

for i in range(len(str(N))):
    for j in range(3 * (10**i), 8 * (10**i)):
        if j > N:
            break
        if '0' not in str(j) and '1' not in str(j) and '2' not in str(j) and '4' not in str(j) and '6' not in str(j) and '8' not in str(j) and '9' not in str(j) and('7' in str(j) and '5' in str(j) and '3' in str(j)):
            count += 1

print(count)

### FIXED CODE ###

import itertools
N = int(input())
count = 0
for i in range(3, len(str(N)) + 1):
    for j in itertools.product('753', repeat=i):
        if int(''.join(j)) <= N and '3' in str(j) and '5'in str(j) and '7' in str(j):
            count += 1

print(count)
### BUGGY CODE ###

import sys
readline = sys.stdin.buffer.readline
from collections import deque
INF = float('inf')


def main():
    H, W, K = map(int, readline().split())
    # いつものパターンと問題文のi,jが逆なので、
    # 問題文のxを変数yに、問題文のyを変数xに代入している
    sy, sx, gy, gx = map(int, readline().split())
    lake = [['@' for _ in range(W+2)]]

    for _ in range(H):
        c = ['@'] + list(readline().decode('utf-8').strip()) + ['@']
        lake.append(c)
    lake.append(['@' for _ in range(W+2)])

    dist = [[INF] * (W+2) for _ in range(H+2)]
    dxy = ((1, 0), (0, 1), (-1, 0), (0, -1))
    Q = deque()
    Q.append((sy, sx, 0))
    dist[sy][sx] = 0
    while Q:
        y,x,d = Q.popleft()
        if y == gy and x == gx:
            print(d)
            sys.exit()
        for dx,dy in dxy:
            n_y = y
            n_x = x
            for k in range(K):
                n_y +=dy
                n_x +=dx

                if lake[n_y][n_x] == '.':
                    if dist[n_y][n_x] == INF:
                        dist[n_y][n_x] = d + 1
                        Q.append((n_y,n_x,d+1))
                    else:
                        continue

                else:
                    break
    print('-1')

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
from collections import deque
 
H, W, K = map(int,readline().split())
x1, y1, x2, y2 = map(int,readline().split())
x1 -= 1; y1 -= 1; x2 -= 1; y2 -= 1
C = read().split()

dist = [[-1]*W for i in range(H)]
dist[x1][y1] = 0
d = deque([[x1, y1]])
dxy= [[1, 0], [0, 1], [-1, 0], [0, -1]]
while d:
  x, y = d.popleft()
  if (x, y) == (x2, y2):
    print(dist[x][y])
    quit()
  for dx, dy in dxy:
    xx = x; yy = y
    for i in range(K):
      xx += dx; yy += dy
      if 0<=xx<H and 0<=yy<W and C[xx][yy]!='@':
        if 0 <= dist[xx][yy] <= dist[x][y]:
          break
        if dist[xx][yy] == -1:
           d.append([xx, yy])
        dist[xx][yy] = dist[x][y] + 1
      else:
        break

print(-1)
### BUGGY CODE ###

def solve():
    H,W=list(map(int,input().split(' ')))
    darker =[]
    cnt = 0
    for i in range(H):
        darker.append(list(input()))
    for i in range(H):
        darker[i].insert(0,'.')
        darker[i].append('.')
    darker.insert(0,['.' for i in range(W+2)])
    darker.append(['.' for i in range(W+2)])
    while True:
        tmp=[]
        for i in range(1,H+1):
            for j in range(1,W+1):
                if darker[i][j] =='.':
                    if darker[i-1][j] =="#" or darker[i][j-1] =="#" or darker[i+1][j] =='#' or darker[i][j+1] =='#':
                        tmp.append([i,j])
        if len(tmp) ==0:
            break
        for i,j in tmp:
            darker[i][j] ='#'

        cnt +=1
    return cnt

print(solve())

### FIXED CODE ###

import numpy as np

def solve():
    H,W=map(int,input().split(' '))
    max_value = H+W
    values =[]
    for i in range(H):
      values.append([0 if i == '#' else max_value for i in list(input())])
    values = np.array(values)

    for x in range(W-1):
        values[:,x+1] = np.minimum(values[:,x]+1,values[:,x+1])
    for x in range(W-1,0,-1):
        values[:,x-1] = np.minimum(values[:,x-1],values[:,x]+1)
    for x in range(H-1):
        values[x+1,:] = np.minimum(values[x,:]+1,values[x+1,:])
    print('')
    for x in range(H-1,0,-1):
        values[x-1,:] = np.minimum(values[x,:]+1,values[x-1,:])
    print(np.max(values))
solve()
### BUGGY CODE ###

N, M = map(int,input().split())
An = list(map(int,input().split()))
for _ in range(M):
  B, C = map(int,input().split())
  An.extend([C]*B)
An.sort(reverse=True)
print(sum(An[0:N]))

### FIXED CODE ###

N, M = map(int,input().split())
An = list(map(lambda x:[int(x),1],input().split()))
D = [[0]*2 for _ in range(M)]
for i in range(M):
  B, C = map(int,input().split())
  D[i] = [C,B]
An.extend(D)
An.sort(reverse=True)
num = 0
cnt = 0
for i in range(len(An)):
  if cnt+An[i][1] >= N:
    num += An[i][0]*(N-cnt)
    print(num)
    break
  else:
    cnt += An[i][1]
    num += An[i][0]*An[i][1]
### BUGGY CODE ###

def isAnagram(str_l, str_r):
	if sorted(str_l)==sorted(str_r): 
		return True 
	else:
		return False


def countPairs(str_arr):
	count = 0
	for i in range(N):
		for j in range(i+1,N):
			if isAnagram(str_arr[i], str_arr[j]):
				count += 1
	return count


N = int(input())
str_arr = []

for i in range(N):
	str = input()
	str_arr.append(str)

print(countPairs(str_arr))

### FIXED CODE ###

import operator as op
from functools import reduce
import math
	

def ncr(n, r):
	if n < r:
		return 0
	else :
		return (math.factorial(n)) / (math.factorial(n-r)*math.factorial(r))

def countPairs(str_arr, N):
	str_cnt = [0]
	str = str_arr[0]
	j = 0
	for i in range(N):
		if(str_arr[i]==str):
			str_cnt[j] += 1
		else:
			str = str_arr[i]
			j += 1
			str_cnt.append(0)
			str_cnt[j] += 1
	count = 0
	for i in range(len(str_cnt)):
		count += ncr(str_cnt[i],2)
	print(int(count))

def main():
	N = int(input())
	str_arr = []
	for i in range(N):
		str = input()
		str_arr.append(sorted(str))
	str_arr = sorted(str_arr)
	countPairs(str_arr, N)


main()
### BUGGY CODE ###

import math
a,b,n=map(int,input().split())
max=0
for i in range(1,n+1):
 s=(math.floor(a*i/b))-a*(math.floor(i/b))
 if s>max:
  max=s
print(max)

### FIXED CODE ###

import math
a,b,n=map(int,input().split())
if b>n:
 max=(math.floor(a*n/b))-a*(math.floor(n/b))
else:
 max=(math.floor(a*(b-1)/b))-a*(math.floor((b-1)/b))
print(max)
### BUGGY CODE ###

n=int(input())
a=[-1]
for _ in range(n):
    x=int(input())
    if a[-1]>=x:
        a.append(x)
    else:
        for i in range(len(a)):
            if a[i]<x:
                a[i]=x
                break
    a.sort(reverse=True)
print(len(a))

### FIXED CODE ###

import bisect
n=int(input())
h=[]
for i in range(n):
  a=int(input())
  if len(h)==0:
    h.append(-1*a)
  elif (-1)*a>=h[-1]:
    h.append(-1*a)
  else:
    index=bisect.bisect_right(h,-1*a)
    h[index]=-1*a
print(len(h))
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    S=list(map(int,list(input())))
    l={}
    for i in range(10):
        l[i]={}
        for j in range(10):
            l[i][j]=[]
    ans=0
    for i in range(N):
        for j in range(N-i-1):
            for k in range(N-i-j-2):
                if not S[i+j+k+2] in l[S[i]][S[i+j+1]]:
                    l[S[i]][S[i+j+1]].append(S[i+j+k+2])
                    ans+=1
    print(ans)
                

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    S=list(map(int,list(input())))
    z=[None]*10
    for i in range(10):
        for j in range(N-2):
            if S[j]==i:
                 z[i]=j
                 break
    y=[[None]*10 for _ in range(10)]
    for x in range(10):
        if z[x] is not None:
            for i in range(10):
                for j in range(z[x]+1,N-1):
                    if S[j]==i:
                        y[x][i]=j
                        break
    ans=0
    for h in range(10):
        for x in range(10):
            if y[h][x] is not None:
                for i in range(10):
                    for j in range(y[h][x]+1,N):
                        if S[j]==i:
                            ans+=1
                            break
    print(ans)
                

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

# TLE実装　O(N^2)

N,K,Q = map(int,input().split())

scores = [K] * N

for i in range(Q):
  a = int(input())
  for j in range(N):
    if j != a - 1:
      scores[j] -= 1

for s in scores:
  print(("No","Yes")[s > 0])


### FIXED CODE ###

N,K,Q = map(int,input().split())

scores = [K - Q] * N

for i in range(Q):
  a = int(input())
  scores[a - 1] += 1

for s in scores:
  print(("No","Yes")[s > 0])
### BUGGY CODE ###

import fractions
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 6) 
mod=10**9+7
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)



def mul(a, b):
    return ((a % mod) * (b % mod)) % mod

def power(x, y):
    if   y == 0     : return 1
    elif y == 1     : return x % mod
    elif y % 2 == 0 : return power(x, y/2)**2 % mod
    else            : return power(x, y/2)**2 * x % mod

def div(a, b):
    return mul(a, power(b, mod-2))

n=input()
hoge=list(map(int,input().split()))
#hoge=[i for i in range(1,10**4)]
ans=0

l=lcm_list(hoge)#%mod
for i in hoge:
    tmp=(l//i)%mod
    ans+=tmp
    ans%=mod
ans%=mod
print(ans)

### FIXED CODE ###

import fractions
from functools import reduce
mod=10**9+7
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


P = 10**9 + 7
N = 10000
inv_t = [0]+[1]
for i in range(2,10**6+1):
  inv_t += [inv_t[P % i] * (P - int(P / i)) % P]
n=input()
hoge=list(map(int,input().split()))
#hoge=[i for i in range(1,10**4)]
ans=0
l=lcm_list(hoge)%mod
for i in hoge:
    tmp=l*inv_t[i]
    ans+=tmp
    ans%=mod
ans%=mod
print(ans)
### BUGGY CODE ###

import sys
import os

def file_input():
    f = open('../Beginner_Contest_164/input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()
    # A,B,C,D=map(int, input().split())
    N = int(input())

    S = []
    for i in range(N):
        str = input()
        if str not in S:
            S.append(str)

    print(len(S))

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import os

def file_input():
    f = open('../Beginner_Contest_164/input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()
    # A,B,C,D=map(int, input().split())
    N = int(input())

    # S = []
    # for i in range(N):
    #     str = input()
    #     if str not in S:
    #         S.append(str)
    #
    # print(len(S))

    S = set()
    for i in range(N):
        S.add(input())

    print(len(S))

    # S = {}
    # val=0
    # for i in range(N):
    #     str = input()
    #     if S.get(str) == None:
    #         S[val]=str
    #         val+=1
    #
    # print(val)

    # val = 0
    # str = ""
    # for i in range(N):
    #     in_str = input()
    #     if str.find(in_str):
    #         str += " "+in_str
    #         val += 1
    #
    # print(val)

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

h,n=[int(i) for i in input().split()]

waza=[None]

class Waza:
    def __init__(self,attack,power):
        self.attack=attack
        self.power=power

maxA=0
for i in range(n):
    a,b=[int(i) for i in input().split()]
    maxA=max(maxA,a)
    waza.append(Waza(a,b))


dp=[[10**9 for i in range(h+maxA)] for j in range(n+1)]

for i in range(n+1):
    for j in range(h+maxA):
        if j==0:
            dp[i][j]=0
        elif i==0:
            pass
        elif j-waza[i].attack>=0:
            dp[i][j]=min(dp[i-1][j],dp[i][j-waza[i].attack]+waza[i].power)

print(min(dp[-1][h:]))


### FIXED CODE ###

h, n = [int(i) for i in input().split()]

magics = [None]


class Magic:
    def __init__(self, attack, cost):
        self.attack = attack
        self.cost = cost


maxA = 0
for i in range(n):
    attack, cost = [int(i) for i in input().split()]
    maxA = max(maxA, attack)
    magics.append(Magic(attack, cost))

dp = [[10 ** 9 for i in range(h + maxA)] for j in range(n + 1)]

for i in range(n + 1):
    for j in range(h + maxA):
        if j == 0:
            dp[i][j] = 0
        elif i == 0:
            continue
        elif j - magics[i].attack >= 0:
            dp[i][j] = min(dp[i - 1][j], dp[i][j - magics[i].attack] + magics[i].cost)
        else:
            dp[i][j] = dp[i - 1][j]

print(min(dp[-1][h:]))
### BUGGY CODE ###

N, M = map(int, input().split())
S = [list(map(int, input().split())) for _ in range(N)]

dp = [[0]*3 for _ in range(M)]
ans = [0]*8

for roop in range(8):
    dp = [[0]*3 for _ in range(M+1)]
    a, b, c = 1, 1, 1
    if roop&1 == 1:
        a = -1
    if (roop>>1)&1 == 1:
        b = -1
    if (roop>>2)&1 == 1:
        c = -1
    for i in range(N):
        for j in range(min(i, M-1), -1, -1):
            if a*(dp[j][0]+S[i][0])+b*(dp[j][1]+S[i][1])+c*(dp[j][2]+S[i][2]) > a*dp[j+1][0]+b*dp[j+1][1]+c*dp[j+1][2]:
                dp[j+1][0] = dp[j][0] + S[i][0]
                dp[j+1][1] = dp[j][1] + S[i][1]
                dp[j+1][2] = dp[j][2] + S[i][2]
    ans[roop] = a*dp[M][0]+b*dp[M][1]+c*dp[M][2]

print(max(ans))

### FIXED CODE ###

N, M = map(int, input().split())
S = [list(map(int, input().split())) for _ in range(N)]

dp = [[0]*3 for _ in range(M)]
ans = [0]*8

for roop in range(8):
    a, b, c = 1, 1, 1
    if roop&1 == 1:
        a = -1
    if (roop>>1)&1 == 1:
        b = -1
    if (roop>>2)&1 == 1:
        c = -1
    dp = [[-a*10**20, -b*10**20, -c*10**20] for _ in range(M+1)]
    dp[0][0] = 0
    dp[0][1] = 0
    dp[0][2] = 0
    for i in range(N):
        for j in range(min(i, M-1), -1, -1):
            if a*(dp[j][0]+S[i][0])+b*(dp[j][1]+S[i][1])+c*(dp[j][2]+S[i][2]) > a*dp[j+1][0]+b*dp[j+1][1]+c*dp[j+1][2]:
                dp[j+1][0] = dp[j][0] + S[i][0]
                dp[j+1][1] = dp[j][1] + S[i][1]
                dp[j+1][2] = dp[j][2] + S[i][2]
    ans[roop] = a*dp[M][0]+b*dp[M][1]+c*dp[M][2]

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

from collections import Counter

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

c = Counter(tree)
if tree[0] != 0 or c[0] != 1:
    print(0)
else:
    ans = 1
    a = c[0]
    for i in range( 1,N):
        t = c[i]
        # print(i,a,t,a**t)
        ans *= ( a**t )
        a = t
    print(ans%998244353)

### FIXED CODE ###

from collections import Counter

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

c = Counter(tree)
if tree[0] != 0 or c[0] != 1:
    print(0)
else:
    ans = 1
    a = c[0]
    for i in range( 1,len(c)):
        t = c[i]
        if t == 0:
            print(0)
            exit()
        else:
            ans *= ( a**t )
            a = t
    print(ans%998244353)
### BUGGY CODE ###

n=int(input())
x=1
lst=list(map(int,input().split()))
for i in lst:
  x*=i
if x<=10**18:
  print(x)
else:
  print('-1')

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
if 0 in a:
  print(0)
else:
  cnt=1
  for i in a:
    cnt*=i
    if cnt>10**18:
      cnt=-1
      break
  print(cnt)
### BUGGY CODE ###

from math import gcd
N = int(input())
A = list(map(int,input().split()))

g = 0
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

def factorize(n):
    d = set()
    m = 2
    while m*m <= n:
        while n%m == 0:
            n //= m
            d.add(m)
        m += 1
    if n > 1:
        d.add(n)
    return d

st = set()
for a in A:
    fac = factorize(a)
    if fac & st:
        print('setwise coprime')
        exit()
    st |= fac
print('pairwise coprime')

### FIXED CODE ###

from math import gcd
N = int(input())
A = list(map(int,input().split()))

g = 0
for a in A:
    g = gcd(g,a)
if g > 1:
    print('not coprime')
    exit()

sa = set()
for a in A:
    if a==1: continue
    if a in sa:
        print('setwise coprime')
        exit()
    sa.add(a)

MAXN = 10**6+10
sieve = [0,0] + [1]*MAXN
p = 2
small_primes = []
while p*p <= MAXN:
    if sieve[p]:
        small_primes.append(p)
        for q in range(2*p,MAXN+1,p):
            sieve[q] = 0
    p += 1

st = set()
for a in A:
    for p in small_primes:
        found = False
        while a%p==0:
            a //= p
            found = True
        if found:
            if p in st:
                print('setwise coprime')
                exit()
            st.add(p)
        if a==1: break
    else:
        if a in st:
            print('setwise coprime')
            exit()
        st.add(a)

print('pairwise coprime')
### BUGGY CODE ###

def main():
    import numpy as np
    n,k=map(int,input().split())
    a=[int(i) for i in input().split()]
    dp=[np.inf]*n
    dp[0]=0
    dp[1]=abs(a[1]-a[0])
    for i in range(2,n):
        for j in range(1,k+1):
            dp[i]=min(dp[i-j]+abs(a[i]-a[i-j]),dp[i])
    print(dp[-1])
if __name__ == '__main__':
	main()

### FIXED CODE ###

n,k=map(int,input().split())
a=[int(i) for i in input().split()]
dp=[10**9]*n
dp[0]=0
dp[1]=abs(a[1]-a[0])
for i in range(2,n):
    for j in range(max(0,i-k),i):
        dp[i]=min(dp[j]+abs(a[i]-a[j]),dp[i])
print(dp[-1])
### BUGGY CODE ###

#abc133 c
L,R=map(int,input().split())
ans=0
R=min(R,L+2019*2)
ans=2018
amari=[]
for i in range(L,R+1):
    tmp=i%2019
    amari.append(tmp)
    if len(amari)==2019*2:
        break
for i in range(len(amari)):
    for j in range(len(amari)):
        if i==j:
            continue
        ans=min(ans,(amari[i]*amari[j])%2019)
print(ans)


### FIXED CODE ###

#abc133 c
L,R=map(int,input().split())
x=R-L
ans=0
R=min(R,L+2019*2)
ans=2018
for i in range(L,R+1):
    for j in range(i+1,R+1):
        amari=(i*j)%2019
        ans=min(ans,amari)
        if ans==0:
            break
print(ans)