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

[N,L] = [int(x) for x in input().split()]
A = {}
B = [0]*N
ANS = {}
count = 0
for i,x in enumerate(input().split()):
    i = int(i)
    x = int(x)
    B[i] = x
    if x in A : A[x] += [i]
    else : A[x] = [i]
for i in sorted(A) :
    for j in A[i] :
        for k in range(L) :
            if j + k not in ANS :
                ANS[j+k] = i
                count += 1
    if count > N * 0.99 : break
        
for i in range(L):
    if i not in ANS : ANS[i] = min(B[:i+1])
for i in range(L,N):
    if i not in ANS : ANS[i] = min(B[i+1-L:i+1])
for i in range(L-1,N-1) : print(ANS[i], end=" ")
print(ANS[N-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 ###

def choose_larger_digit(a, b):
    return max(number_of_digits(a), number_of_digits(b))


def number_of_digits(n):
    digit = 0
    while n>0:
        digit = digit + 1
        n = int(n/10)
    return digit


n = int(input())
min_digits_diff = float('inf')
for a in range(1, n+1):
    b = int(n / a)
    if n == a * b:
        min_digits_diff = min(min_digits_diff, choose_larger_digit(a, b))
print(min_digits_diff)

### FIXED CODE ###

# atcoder
import math

def get_number_of_digits(n):
    return int(math.log10(n) + 1)

def get_larger_digits(a, b):
    return max(get_number_of_digits(a), get_number_of_digits(b))

n = int(input())
min_digit = float('inf')
for a in range(1, int(math.sqrt(float(n))+5.0)):
    if n % a != 0:
        continue
    b = int(n / a)
    if n == a * b:
        temp_digit = get_larger_digits(a, b)
        min_digit = min(min_digit, temp_digit)
print(min_digit)
### BUGGY CODE ###

class SegmentTree:
    seg_len = 1
    node = []
    def __init__(self, n):
        while self.seg_len < n:
            self.seg_len <<= 1
        self.node = [ 0 for _ in range(self.seg_len*2) ]

    def add(self, idx, v):
        idx += self.seg_len
        self.node[idx] += v
        while True:
            idx //= 2
            if idx == 0:
                break
            self.node[idx] = self.node[idx*2] + self.node[idx*2+1]

    def sum(self, l, r):
        l += self.seg_len
        r += self.seg_len
        ret = 0
        while l < r:
            if l & 1 == 1:
                ret += self.node[l]
                l += 1
            if r & 1 == 1:
                ret += self.node[r-1]
                r -= 1
            l //= 2; r //= 2;
        return ret


n, k = map(int, input().split())
p = [ int(x) for x in input().split() ]

seg_tree = SegmentTree(n)
for i in range(n):
    seg_tree.add(i, (1+p[i])/2)

ans = 0
for i in range(n-k+1):
    ans = max(ans, seg_tree.sum(i, i+k))

print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
p = [ int(x) for x in input().split() ]
s = [ 0 ]

for key, v in enumerate(p):
    t = (v+1)*v//2/v
    s.append(s[key] + t)

ans = -1

for i in range(n-k+1):
    v = s[i+k]-s[i]
    ans = max(ans, v)

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

N = int(input())
*P, = map(float, input().split())
dp = [[0]*(N+1) for _ in range(N)]
dp[0][0] = 1 - P[0]; dp[0][1] = P[0]
for i in range(1, N):
    for j in range(i+2):
        dp[i][j] = dp[i-1][j] * (1 - P[i]) + dp[i-1][j-1] * P[i]
print(sum(dp[N-1][N//2 + 1:]))

### FIXED CODE ###

N = int(input())
*P, = map(float, input().split())
dp = [[0]*(N+1) for _ in range(N)]
dp[0][0] = 1 - P[0]; dp[0][1] = P[0]
for i in range(1, N):
    for j in range(i+2):
        dp[i][j] = dp[i-1][j] * (1 - P[i]) + dp[i-1][j-1] * P[i]
print(sum(dp[N-1][N//2 + 1:]))
### BUGGY CODE ###

n = int(input())

count = 0
aset = [0]*(n+1)
for x in range(1,n-1):
    for y in range(x,n-1):
        for z in range(y,n-1):
            a = x**2+y**2+z**2+x*y+y*z+z*x
            if a <= n:
                if x == y and y ==z:
                    aset[a] +=1
                else:
                    aset[a] +=3

for i in range(1,n+1):
    print(aset[i])


### FIXED CODE ###


import math
n = int(input())

sqn = int(math.sqrt(n))+1
count = 0
aset = [0]*(n+1)
for x in range(1,sqn):
    for y in range(x,sqn):
        for z in range(y,sqn):
            a = x**2+y**2+z**2+x*y+y*z+z*x
            if a <= n:
                if x == y and y ==z:
                    aset[a] +=1
                else:
                    if x == y or y ==z:
                        aset[a] +=3
                    else:
                        aset[a] +=6

for i in range(1,n+1):
    print(aset[i])
### BUGGY CODE ###

def func(b, n):
    res = 0
    while n > 0:
        res += n % b
        n //= b
    return res


def solve():
    n = int(input())
    s = int(input())

    if n == s:
        return n + 1
    elif n < s:
        return -1

    for b in range(2, n + 1):
        if b**2 > n:
            break
        if func(b, n) == s:
            return b

    b_cand = []
    for p in range(1, n + 1):
        if p**2 > n:
            break
        b = (n - s) // p + 1
        b_cand.append(b)
    b_cand = b_cand[::-1]

    for b in b_cand:
        if func(b, n) == s:
            return b

    return -1


ans = solve()
print(ans)


### FIXED CODE ###

def func(b, n):
    res = 0
    while n > 0:
        res += n % b
        n //= b
    return res


def solve():
    n = int(input())
    s = int(input())

    if n == s:
        return n + 1
    elif n < s:
        return -1

    for b in range(2, n + 1):
        if b**2 > n:
            break
        if func(b, n) == s:
            return b

    b_cand = []
    for p in range(1, n + 1):
        if p**2 > n:
            break
        b = (n - s) // p + 1
        if b > 1:
            b_cand.append(b)
    b_cand = b_cand[::-1]

    for b in b_cand:
        # print(b)
        if func(b, n) == s:
            return b

    return -1


ans = solve()
print(ans)
### BUGGY CODE ###

from collections import deque
n , m , k = map(int,input().split())
tomo = [set() for i in range(n+1)]
bro = [set() for i in range(n+1)]
for i in range(m):
    a , b = map(int,input().split())
    tomo[a].add(b)
    tomo[b].add(a)
for i in range(k):
    c , d = map(int,input().split())
    bro[c].add(d)
    bro[d].add(c)

visit = [True for i in range(n+1)]
kurasuta = []
for i in range(1,n+1):
    if visit[i]:
        kar = [i]
        d = deque()
        d.append(i)
        visit[i] = False
        cou = 1
        while d:
            now = d.popleft()
            for j in tomo[now]:
                if visit[j]:
                    cou += 1
                    visit[j] = False
                    kar.append(j)
                    d.append(j)
        kurasuta.append([kar,cou])
    else:
        continue
ans = [0 for i in range(n)]

for i in range(len(kurasuta)):
    for j in range(kurasuta[i][1]):
        for k in range(j+1,kurasuta[i][1]):
            if (not kurasuta[i][0][k] in tomo[kurasuta[i][0][j]]) and (not kurasuta[i][0][k] in bro[kurasuta[i][0][j]]):
                ans[kurasuta[i][0][k]-1] += 1
                ans[kurasuta[i][0][j]-1] += 1
print(*ans)

### FIXED CODE ###

from collections import deque
n , m , k = map(int,input().split())
tomo = [set() for i in range(n+1)]
to = [0 for i in range(n+1)]
bro = [set() for i in range(n+1)]
for i in range(m):
    a , b = map(int,input().split())
    tomo[a].add(b)
    tomo[b].add(a)
    to[a] += 1
    to[b] += 1
for i in range(k):
    c , d = map(int,input().split())
    bro[c].add(d)
    bro[d].add(c)

visit = [True for i in range(n+1)]
kurasuta = []
for i in range(1,n+1):
    if visit[i]:
        kar = {i}
        d = deque()
        d.append(i)
        cou = 1
        visit[i] = False
        while d:
            now = d.popleft()
            for j in tomo[now]:
                if visit[j]:
                    visit[j] = False
                    kar.add(j)
                    d.append(j)
                    cou += 1
        kurasuta.append([kar,cou])
    else:
        continue
ans = [0 for i in range(n)]

for i in range(len(kurasuta)):
    for j in kurasuta[i][0]:
        ans[j-1] = kurasuta[i][1] - to[j] - 1 - len(kurasuta[i][0] & bro[j])

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

def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort(reverse=True)
    u = 2 *  A[0]
    l = 0
    k = []
    jj = 0
    while True:
        jj += 1
        m = (u + l)//2
        t = 0
        s = N
        p = 0
        for i in range(N):
            for j in reversed(range(s)):
                if A[i] + A[j] >= m:
                    if A[i] + A[j] == m:
                        p += 1
                    k.append(j)
                    t += j+1
                    s = j+1
                    break
        if t >= M and t - p <= M:
            break
        elif t > M:
            l = m
        else:
            u = m
        k = []
    r = 0   
    s = N
    B = []
    tmp = 0
    for i in A:
        tmp += i
        B.append(tmp)
    for i in range(len(k)):
        r += (k[i]+1) * A[i] + B[k[i]]
    return r - (t - M) * m
    
print(main())
    


### FIXED CODE ###

import bisect
def judge(k, N, A):
    t = 0
    for i in A:
        j = bisect.bisect_left(A, k - i)
        t += N - j
    return t
def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    A.sort()
    t = A[-1] * 2
    b = 0
    X = None
    while t - b > 1:
        m = (t + b)//2
        i = judge(m, N, A)
        if i == M:
            X = m
            break
        if i > M:
            ip = judge(m + 1, N, A)
            if ip == M:
                X = m + 1
                break
            if ip < M:
                X = m
                break
            b = m + 1
        if i < M:
            im = judge(m - 1, N, A)
            if im >= M:
                X = m - 1
                break
            t = m - 1
    if X is None:
        X = b
    B = []
    tmp = 0
    for i in reversed(range(N)):
        tmp += A[i]
        B.append(tmp)
    B.reverse()
    r = 0
    tot = 0
    for i in reversed(range(N)):
        j = bisect.bisect_left(A, X - A[i])
        tot += N - j
        if j == N:
            break
        r += A[i] * (N - j) + B[j]
    return r - (tot - M) * X
print(main())
### BUGGY CODE ###

import fractions
from itertools import combinations
import heapq
def cf(x1,x2):
    cf=[1]
    for i in range(2,min(x1,x2)+1):
        if x1 % i == 0 and x2 % i == 0:
            cf.append(i)
    return cf
def compromise(x1, x2):
    f = fractions.gcd(x1, x2)
    return f == 1
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
def isPrime(n):
  if n < 2:
    # 2未満は素数でない
    return False
  if n == 2:
    # 2は素数
    return True
  for p in range(2, n):
      if n % p == 0:
        # nまでの数で割り切れたら素数ではない
        return False
  # nまでの数で割り切れなかったら素数
  return True

a, b = map(int, input().split())
cfs = cf(a, b)
total = len(cfs)
for c in cfs:
    if not isPrime(c):
        total -= 1
print(total+1)

### FIXED CODE ###

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
a, b = map(int, input().split())
apri = set(prime_factorize(a))
bpri = set(prime_factorize(b))
print(len(apri & bpri)+1)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**5)

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

par = [i for i in range(0, n + 1)]
d2p = [0 for i in range(0, n + 1)]

def root(x):
    global par
    global d2p
    if par[x] == x:
        return (x, 0)
    else:
        r = root(par[x])
        par[x] = r[0]
        d2p[x] += r[1]
        #print(par, d2p)
        return (r[0], d2p[x])


def unite(x, y, d):
    global par
    global d2p
    #print(x, y, d)
    rx, dx = root(x)
    ry, dy = root(y)
    if rx != ry:
        par[rx] = ry
        d2p[rx] = dy + d - dx
        #print(par, d2p,"noz")
        return True
    else:
        if dx - dy != d:
            #print(rx, ry, dx, dy)
            return False
        else:
            return True

l = [0] * m
r = [0] * m
d = [0] * m

for i in range(0, m):
    l[i], r[i], d[i] = [int(j) for j in input().split(" ")]

f = True
for i in range(0, m):
    if not unite(l[i], r[i], d[i]):
        f = False
        break

if f:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

import queue

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

g = [[] for i in range(0, n + 1)]
v = [0] * (n + 1)
v_asn = [False] * (n + 1)
f = True

for i in range(0, m):
    l, r, d = [int(i) for i in input().split(" ")]
    g[l].append([r, d])
    g[r].append([l, -d])

for i in range(1, n + 1):
    if not v_asn[i]:
        q = queue.Queue()
        v_asn[i] = True
        q.put(i)
        while not q.empty():
            qi = q.get()
            for a in g[qi]:
                if not v_asn[a[0]]:
                    v_asn[a[0]] = True
                    v[a[0]] = v[qi] + a[1]
                    q.put(a[0])
                else:
                    if v[a[0]] != v[qi] + a[1]:
                        f = False
                        break
        if not f:
            break

if f:
    print("Yes")
else:
    print("No")
### BUGGY CODE ###

import statistics
N = int(input())
X = list(map(int,input().split()))
for i in range(1,N+1):
    tmp = X[0:i-1]+X[i:]
    print(statistics.median(tmp))

### FIXED CODE ###

N = int(input())
X = list(map(int,input().split()))
a = sorted(X)
b = a[N//2]
c = a[(N//2)-1]
for i in X:
    print(b if i<b else c)
### BUGGY CODE ###

S = input()
dp = [[0 for i in range(4)] for i in range(len(S)+1)]
MOD = 10**9+7
dp[0][3] = 1
for i in range(len(S)):
    if S[i] == '?': k = 3
    else: k = 1
    for _ in range(k):
      for l in range(4):
        dp[i+1][l] += dp[i][l] 
    if S[i] == 'A':
        dp[i+1][0] +=  dp[i][3]
    elif S[i] == 'B':
        dp[i+1][1] +=  dp[i][0]
    elif S[i] == 'C':
        dp[i+1][2] += dp[i][1]
    else:
        dp[i+1][0] += dp[i][3]
        dp[i+1][1] += dp[i][0]
        dp[i+1][2] += dp[i][1]
    for j in range(4):
        if dp[i][j] > MOD: dp[i][j] %= MOD
print(dp[len(S)][2]%MOD)


### FIXED CODE ###

S = input()
dp = [[0 for i in range(4)] for i in range(len(S)+1)]
MOD = 10**9+7
dp[0][3] = 1
for i in range(len(S)):
    if S[i] == '?': k = 3
    else: k = 1
    for _ in range(k):
        dp[i+1][0] += dp[i][0] 
        dp[i+1][1] += dp[i][1] 
        dp[i+1][2] += dp[i][2] 
        dp[i+1][3] += dp[i][3] 
    if S[i] == 'A':
        dp[i+1][0] +=  dp[i][3]
    elif S[i] == 'B':
        dp[i+1][1] +=  dp[i][0]
    elif S[i] == 'C':
        dp[i+1][2] += dp[i][1]
    else:
        dp[i+1][0] += dp[i][3]
        dp[i+1][1] += dp[i][0]
        dp[i+1][2] += dp[i][1]
    for j in range(4):
        if dp[1+i][j] > MOD: dp[i+1][j] %= MOD
print(dp[len(S)][2]%MOD)
### BUGGY CODE ###

n,a,b = map(int,input().split())
A = [x for x in range(a,b+1)]
minA = a*(n-1)+b
maxA = b*(n-1)+a
print(max(maxA-minA+1,0))

### FIXED CODE ###

n,a,b = map(int,input().split())
minA = a*(n-1)+b
maxA = b*(n-1)+a
print(max(maxA-minA+1,0))
### BUGGY CODE ###

# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
from statistics import median_low,median_high,median
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
arrX = list(map(int,input().split()))
# arrA = np.array(input().split(),dtype=np.int64)

for i in range(N):
    lis = arrX[:i] + arrX[i+1:]
    lis.sort()
    print(median(lis))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))


### FIXED CODE ###

# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
from statistics import median_low,median_high
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
N = int(input())
arrX = list(map(int,input().split()))
# arrA = np.array(input().split(),dtype=np.int64)

X = sorted(arrX)
low = median_low(X)
high = median_high(X)

for i in arrX:
    if i <= low:
        print(high)
    elif i >= high:
        print(low)

# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))
### BUGGY CODE ###

n,m,q = map(int, input().split())
mmap = [ [ 0 for j in range(n+1) ] for i in range(n+1) ]
for i in range(m):
  s,e = map(int, input().split())
  mmap[s][e] += 1
for i in range(q):
  s,e = map(int, input().split())
  cnt = 0
  for j in range(s,e+1):
    for k in range(s,e+1):
      cnt += mmap[j][k]
  print(cnt)

### FIXED CODE ###

n,m,q = map(int, input().split())
mmap = [ [ 0 for j in range(n+1) ] for i in range(n+1) ]
for i in range(m):
  s,e = map(int, input().split())
  mmap[s][e] += 1
for i in range(n+1):
  for j in range(1,n+1):
    mmap[i][j] = mmap[i][j] + mmap[i][j-1]
for j in range(n+1):
  for i in range(n-1,0,-1):
    mmap[i][j] = mmap[i][j] + mmap[i+1][j]
for i in range(q):
  s,e = map(int, input().split())
  print(mmap[s][e])
### BUGGY CODE ###

import sys
# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))

# ===CODE===

eps = 10 ** (-9)


def main():
    n = ni()
    a = na()

    seta = set(a)
    cnta = collections.Counter(a)
    lista = list(seta)
    lista.sort()

    ans = 0

    for ai in lista:
        if cnta[ai] > 1:
            continue
        flg = True
        for div in lista:
            if div >= ai:
                break
            if ai % div == 0:
                flg = False
                break
        if flg:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
# import re
import math
import collections
# import decimal
import bisect
import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

# import numpy as np

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))

# ===CODE===

eps = 10 ** (-9)


def main():
    n = ni()
    a = na()

    seta = set(a)
    cnta = collections.Counter(a)
    lista = list(seta)
    lista.sort()

    table = [True for _ in range(10 ** 6 + 1)]
    ans = 0

    for ai in lista:
        if table[ai]:
            if cnta[ai] == 1:
                ans += 1
            for i in range(ai, 10 ** 6 + 1, ai):
                table[i] = False

    print(ans)


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

n,q = map(int,input().split())
s = input()
lr = [tuple(map(int,input().split())) for _ in range(q)]
for i in range(q):
  temp = s[lr[i][0]-1:lr[i][1]]
  cnt =0
  j = -1
  while True:
    j = temp.find('AC')
    temp = temp[j+1:]
    if j == -1:
      break
    cnt += 1
  print(cnt)

### FIXED CODE ###

n,q = map(int,input().split())
s = input()

ac = [0] * (n - 1)
for i in range(n-1):
  if s[i] == 'A' and s[i+1] == 'C':
    ac[i] = 1

acc = [0] * n
for i in range(n-1):
  acc[i+1] = acc[i] + ac[i]

lr = [tuple(map(int,input().split())) for _ in range(q)]
for i in range(q):
  l = lr[i][0] - 1
  r = lr[i][1] - 1
  print(acc[r] - acc[l])
### BUGGY CODE ###

N, K = map(int, input().split())
A = [int(a) for a in input().split()]
A = [0 if a >= K else a for a in A]
X = [1] * N
Y = [1] * N
m = (1<<K*13) - 1
for i in range(N-1):
    X[i+1] = X[i] * ((1<<13*A[i]) + 1 if A[i] else 1) & m
for i in range(1, N)[::-1]:
    Y[i-1] = Y[i] * ((1<<13*A[i]) + 1 if A[i] else 1) & m

ans = N
for i in range(N):
    if A[i] == 0 or ((X[i] * Y[i] & m) >> 13 * (K - A[i])) & ((1 << 13 * A[i]) - 1):
        ans -= 1
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
A = [int(a) for a in input().split()]
A = [0 if a >= K else a for a in A]
X = [1] * N
Y = [1] * N
m = (1<<K*8) - 1
for i in range(N-1):
    X[i+1] = (X[i] | X[i] << 8 * A[i]) & m if A[i] else X[i]
for i in range(1, N)[::-1]:
    Y[i-1] = (Y[i] | Y[i] << 8 * A[i]) & m if A[i] else Y[i]

ans = N
for i in range(N):
    if A[i] == 0 or ((X[i] * Y[i] & m) >> 8 * (K - A[i])) & ((1 << 8 * A[i]) - 1):
        ans -= 1
print(ans)
### BUGGY CODE ###

n,k,q=list(map(int,input().split()))
s=[k]*n
for i in range(q):
  a=int(input())
  s=list(map(lambda x:x-1,s))
  s[a-1]+=1
for j in range(n):
  if s[j]>0:print('Yes')
  else:print('No')

### FIXED CODE ###

n,k,q=list(map(int,input().split()))
s=[k]*n
for i in range(q):
  a=int(input())
  s[a-1]+=1
s=list(map(lambda x:x-q,s))
t=list(map(lambda x:print('Yes') if x>0 else print('No'),s))
### BUGGY CODE ###

import math

A = 1
N = int(input())
array = input().split()
for i in range(N):
	A = (A * int(array[i]))
if A > math.pow(10,18):
	print(-1)
else:
  print(A)



### FIXED CODE ###

import math
 
A = 1
N = int(input())
array = input().split()
flag = True
for i in range(N):
	A = (A * int(array[i]))
	if A > math.pow(10,18):
		flag = False
		break

if flag:
  print(A)
else:
  if '0' in array:
    print(0)
  else:
    print(-1)