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

from _bisect import bisect_left

N = int(input())
L = list(map(int, input().split()))
L.sort()

cnt = 0
for i in range(0, N - 2):
    for j in range(i + 1, N - 1):
        t = L[i] + L[j]
        idx = bisect_left(L, t, lo=j + 1)
        cnt += max(0, idx - j - 1)
print(cnt)


### FIXED CODE ###

N = int(input())
L = list(map(int, input().split()))
L.sort()
 
from bisect import bisect_left 
cnt = 0
for i in range(0,N-2):
  for j in range(i+1,N-1):
    t = L[i]+L[j]
    idx = bisect_left(L,t,j+1)
    cnt += max(0,idx-j-1)
print(cnt)
### BUGGY CODE ###

a,b,c=map(int,input().split())
for i in range(10**9):
    if i*a%b==c:
        print('YES')
        exit()

print('NO')


### FIXED CODE ###

a,b,c=map(int,input().split())
for i in range(1,b+1):
    if i*a%b==c:
        print('YES')
        exit()

print('NO')
### BUGGY CODE ###

s = input()
count = 0
s = s + "a"
while True:
    if "01" in s:
        s = s.replace("01", "", 1)
        count += 2
    elif "10" in s:
        s = s.replace("10", "", 1)
        count += 2
    else:
        break
print(count)


### FIXED CODE ###

s = input()
cube_list = [s[0]]
s = s[1:]
count = 0
for c in s:
    if cube_list:
        if cube_list[-1] == c:
            cube_list.append(c)
        else:
            count += 2
            cube_list.pop(-1)
    else:
        cube_list.append(c)
print(count)
### BUGGY CODE ###

import bisect
from collections import deque
x,y,a,b,c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)
red_que = p[:x]
green_que = q[:y]
red_que.reverse()
green_que.reverse()
for i in range(c):
    if red_que[0] < green_que[0]:
        if red_que[0] < r[i]:
            del red_que[0]
            bisect.insort_left(red_que, r[i])

    else:
        if green_que[0] < r[i]:
            del green_que[0]
            bisect.insort_left(green_que, r[i])
print(sum(green_que) + sum(red_que))

### FIXED CODE ###

import heapq
from collections import deque
import sys
input = sys.stdin.readline
x,y,a,b,c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort(reverse=True)
red_que = p[a-x:]
heapq.heapify(red_que)
green_que = q[b-y:]
heapq.heapify(green_que)
for i in range(c):
    re_mi = heapq.heappop(red_que)
    gr_mi = heapq.heappop(green_que)
    if re_mi < gr_mi:
        if re_mi < r[i]:
            heapq.heappush(red_que,r[i])
            heapq.heappush(green_que,gr_mi)
        else:
            heapq.heappush(green_que,gr_mi)
            heapq.heappush(red_que,re_mi)
            break
    else:
        if gr_mi < r[i]:
            heapq.heappush(red_que,re_mi)
            heapq.heappush(green_que,r[i])
        else:
            heapq.heappush(green_que,gr_mi)
            heapq.heappush(red_que,re_mi)
            break
print(sum(green_que) + sum(red_que))
### BUGGY CODE ###

n = int(input())
DifMax = -99999999999

R = [int(input())]
for i in range(1, n):
  RMin = min(R)
  R.append(int(input()))
  if DifMax < R[i] - RMin:
    DifMax = R[i] - RMin

print(DifMax)

### FIXED CODE ###

n = int(input())
DifMax = -9999999999999

R = [int(input())]
RMin = R[0]
for i in range(1, n):
  if RMin > R[i-1]:
      RMin = R[i-1]
  R.append(int(input()))
  if DifMax < R[i] - RMin:
    DifMax = R[i] - RMin

print(DifMax)
### BUGGY CODE ###

def main():
    import heapq
    inf = 10**16
    n, m, s = map(int, input().split())
    uvab = [list(map(int, input().split())) for _ in [0]*m]
    cd = [list(map(int, input().split())) for _ in [0]*n]
    g = [[] for _ in [0]*n]
    [g[a-1].append([b-1, c, d]) for a, b, c, d in uvab]
    [g[b-1].append([a-1, c, d]) for a, b, c, d in uvab]
    vertex = [[inf]*4001 for _ in [0]*n]
    h = [(0, 0, min(s, 4000))]  # 時刻、位置、所持金
    heapq.heapify(h)
    while h:
        t, p, money = heapq.heappop(h)
        if vertex[p][money] != inf:
            continue
        vertex[p][money] = t
        newmoney = min(money+cd[p][0], 4000)
        if vertex[p][newmoney] == inf:
            heapq.heappush(h, (t+cd[p][1], p, newmoney))
        for a, b, c in g[p]:  # 行き先、運賃、時間
            if money < b:
                continue
            if vertex[a][money-b] != inf:
                continue
            heapq.heappush(h, (t+c, a, money-b))
    for i in vertex[1:]:
        print(min(i))


main()

### FIXED CODE ###

def main():
    import heapq
    inf = 10**16
    n, m, s = map(int, input().split())
    uvab = [list(map(int, input().split())) for _ in [0]*m]
    cd = [list(map(int, input().split())) for _ in [0]*n]
    g = [[] for _ in [0]*n]
    [g[a-1].append([b-1, c, d]) for a, b, c, d in uvab]
    [g[b-1].append([a-1, c, d]) for a, b, c, d in uvab]
    vertex = [[inf]*2501 for _ in [0]*n]
    h = [(0, 0, min(s, 2500))]  # 時刻、位置、所持金
    heapq.heapify(h)
    while h:
        t, p, money = heapq.heappop(h)
        if vertex[p][money] != inf:
            continue
        vertex[p][money] = t
        newmoney = min(money+cd[p][0], 2500)
        if vertex[p][newmoney] == inf:
            heapq.heappush(h, (t+cd[p][1], p, newmoney))
        for a, b, c in g[p]:  # 行き先、運賃、時間
            if money < b:
                continue
            if vertex[a][money-b] != inf:
                continue
            heapq.heappush(h, (t+c, a, money-b))
    for i in vertex[1:]:
        print(min(i))


main()
### BUGGY CODE ###

n = int(input())
s = input()

ans = 0
for i in range(n-2):
    one = s[i]
    for j in range(i+1,n-1):
        if one == s[j]:
            continue
        two = s[j]
        l = j-i
        for k in range(j+1,n):
            if s[k] != one and s[k] != two:
                if k-j != l:
                    ans += 1

print(ans)

### FIXED CODE ###

n = int(input())
s = input()
 
ans = s.count("R") * s.count("G") * s.count("B")
for i in range(n-2):
    for j in range(i+1,n-1):
        k = 2*j-i
        if k < n:
            if s[k] != s[i] and s[k] != s[j] and s[i] != s[j]:
                    ans -= 1
                    
print(ans)
### BUGGY CODE ###

N=int(input())

H=list(str(input()))


m = 0 
for i in range(N):
    c = 0
    for s in range(N):
        if i > s and H[s] == 'W':
            c += 1
        
        if i < s and H[s] == 'E':
            c += 1
    
    if m == 0 or m >c:
        m = c
        


print(m)

### FIXED CODE ###

from itertools import accumulate

N=int(input())
s=str(input())


a = accumulate(c=='W' for c in 'X'+s[:-1])
b = reversed(list(accumulate(c=='E' for c in 'X'+s[-1:0:-1])))
print(min(x + y for x, y in zip(a, b)))
### BUGGY CODE ###

n = int(input())

power = 1

for i in range(1, n+1):
    power *= i

print(power % (10**9 + 7))


### FIXED CODE ###

import math
n = int(input())

power = math.factorial(n)

print(power % (10**9 + 7))
### BUGGY CODE ###

N=int(input())
d=list(map(int, input().strip().split()))
ans=0

d.sort()

for i in range(int(d[int(N/2)-1]),int(d[int(N/2)]+1)):
    ABC=0
    ARC=0
    for j in range(int(N)):

        if d[j]<i:
            ABC+=1
        else:
            ARC+=1

    if ARC==ABC:
        ans+=1

print(ans)


### FIXED CODE ###

N=int(input())
d=list(map(int, input().strip().split()))
ans=0

d.sort()

#for i in range(int(d[int(N/2)-1]),int(d[int(N/2)]+1)):

print(int(d[int(N/2)])-int(d[int(N/2)-1]))
### BUGGY CODE ###

import math
N = int(input())
A = [int(s) for s in input().split()]
B = [0 for i in range(N)]
def nCr(n, r):
  if n <= 1:
    return 0
  else:
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))
for i in range(N):
  B[A[i]-1] += 1
Ctot = 0
for i in range(N):
  Ctot += nCr(B[i], 2)
for i in range(N):
  current_idx = A[i]-1
  if B[current_idx] == 1:
    count = Ctot
  else:
    count = Ctot + nCr(B[current_idx]-1, 2) - nCr(B[current_idx], 2)
  print(count)

### FIXED CODE ###

N = int(input())
A = [int(s) for s in input().split()]
B = [0 for i in range(N)]
def nC2(n):
  return n*(n-1)//2
for i in range(N):
  B[A[i]-1] += 1
Ctot = 0
for i in range(N):
  Ctot += nC2(B[i])
for i in range(N):
  current_idx = A[i]-1
  if B[current_idx] == 1:
    count = Ctot
  else:
    count = Ctot + nC2(B[current_idx]-1) - nC2(B[current_idx])
  print(count)
### BUGGY CODE ###

nk = input().split()
n = int(nk[0])
k = int(nk[1])
alist = [int(a) for a in input().split()]


bit_count = [{0: 0, 1: 0} for i in range(42)]
for i in range(42):
    for a in alist:
        b = a >> i
        b &= 1
        which = 0 if b == 1 else 1
        bit_count[i][which] += 1


def calc_pow_multiple(digit, selected):
    count = bit_count[digit][selected]
    ret = 1<<digit
    ret *= count
    return ret


def calc_maxsum(kk, digit):
    if digit < 0:
        return 0
    if (kk<<(digit + 1)) - 1 == digit:
        partsum_0 = calc_pow_multiple(digit, 0)
        partsum_1 = calc_pow_multiple(digit, 1)
        return max(partsum_0, partsum_1) + calc_maxsum(kk>>1, digit - 1)

    kkbit = kk >> digit
    kkbit &= 1

    if kkbit == 0:
        return calc_pow_multiple(digit, 0) + calc_maxsum(kk, digit - 1)

    sum_0 = calc_pow_multiple(digit, 0) + calc_maxsum((1<<digit) - 1, digit - 1)
    sum_1 = calc_pow_multiple(digit, 1) + calc_maxsum(kk, digit - 1)
    return max(sum_0, sum_1)


print(calc_maxsum(k, 41))


### FIXED CODE ###

nk = input().split()
n = int(nk[0])
k = int(nk[1])
alist = [int(a) for a in input().split()]


bit_count = [{0: 0, 1: 0} for i in range(42)]
for i in range(42):
    for a in alist:
        b = a >> i
        b &= 1
        which = 0 if b == 1 else 1
        bit_count[i][which] += 1


def calc_pow_multiple(digit, selected):
    count = bit_count[digit][selected]
    ret = 1<<digit
    ret *= count
    return ret


def calc_maxsum(kk, digit):
    if digit < 0:
        return 0
    if kk == (1<<(digit + 1)) - 1:
        partsum_0 = calc_pow_multiple(digit, 0)
        partsum_1 = calc_pow_multiple(digit, 1)
        return max(partsum_0, partsum_1) + calc_maxsum(kk>>1, digit - 1)

    kkbit = kk >> digit
    kkbit &= 1

    if kkbit == 0:
        return calc_pow_multiple(digit, 0) + calc_maxsum(kk, digit - 1)

    sum_0 = calc_pow_multiple(digit, 0) + calc_maxsum((1<<digit) - 1, digit - 1)
    sum_1 = calc_pow_multiple(digit, 1) + calc_maxsum(kk, digit - 1)
    return max(sum_0, sum_1)


print(calc_maxsum(k, 41))
### BUGGY CODE ###

import collections
n = int(input())
s_count = []
for i in range(n):
    s = input()
    cnt = collections.Counter(s)
    cnt_list = list(cnt.items())
    c_sorted = sorted(cnt_list)
    s_count.append(c_sorted)
ans = 0
for i in range(n-1):
    for j in range(i+1, n):
        if s_count[i] == s_count[j]:
            ans += 1
print(ans)


### FIXED CODE ###

import collections
n = int(input())
#a, b, x = list(map(int, input().split()))
#b = list(map(int, input().split()))
s_dic = {}
ans = 0
for i in range(n):
    s = input()
    s = ''.join(sorted(list(s)))
    if s in s_dic:
        # 辞書のキーで管理
        ans += s_dic[s]
        s_dic[s] += 1
    else:
        s_dic[s] = 1

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

import itertools
import functools
import math
from collections import Counter
from itertools import combinations
import re



def main_sum():
    N,M,K=map(int,input().split())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))

    A_len = len(A)
    B_len = len(B)

    Asum = [0] * (A_len + 1)
    Bsum = [0] * (B_len + 1)

    maxA = 0
    maxB = 0

    add = 0
    for i in range(1,A_len+1):
        add += A[i-1]
        Asum[i] = add
        if add <= K:
            maxA = i + 1
        else:
            break

    add = 0
    for i in range(1,B_len+1):
        add += B[i-1]
        Bsum[i] = add
        if add <= K:
            maxB = i + 1
        else:
            break

    ans = 0
    prevmax = 0
    for i in reversed(range(maxA)):
        for j in range(prevmax,maxB):
            if Asum[i] + Bsum[j] <= K:
                if ans < i + j:
                    ans = i + j
                    prevmax = j
            else:
                break

    print(ans)

main_sum()


### FIXED CODE ###

import itertools
import functools
import math
from collections import Counter
from itertools import combinations
import re



def main_sum():
    N,M,K=map(int,input().split())
    A = list(map(int,input().split()))
    B = list(map(int,input().split()))

    A_len = len(A)
    B_len = len(B)

    Asum = [0] * (A_len + 1)
    Bsum = [0] * (B_len + 1)

    maxA = len(A) + 1
    maxB = len(B) + 1

    add = 0
    for i in range(1,A_len+1):
        Asum[i] = A[i-1] + Asum[i-1]

    add = 0
    for i in range(1,B_len+1):
        Bsum[i] = B[i-1] + Bsum[i-1]

    ans = 0
    prev = 0
    for i in reversed(range(maxA)):
        for j in range(prev,maxB):
            if Asum[i] + Bsum[j] <= K:
                prev = j
                if ans < i + j:
                    ans = i + j
                if j == (maxB - 1):
                    print(ans)
                    exit()
            else:
                break

    print(ans)




main_sum()
### BUGGY CODE ###

N = int(input())
A = [int(i) for i in input().split()]
 
B = [0]
[B.append(B[i]+A[i]) for i in range(N)]
B.sort()
 
ans = 0
for i in range(N):
    for j in range(i+1,N+1):
        if B[i] == B[j]:
            ans += 1
        else:
            break
 
print(ans)

### FIXED CODE ###

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

B = {}
B[0] = 1

s = 0
ans = 0

for a in A:
    s += a
    ans += B.get(s,0)
    B[s] = B.get(s,0)+1

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

N = int(input())
S = [sorted(list(input())) for i in range(N)]
num = 0
for i in range(N - 1):
    for j in range(i + 1, N):
        if S[i] == S[j]:
            num += 1
print(num)

### FIXED CODE ###

import collections
N = int(input())
S = [''.join(sorted(list(input()))) for i in range(N)]
c = collections.Counter(S)
print(sum([int(x * (x - 1) / 2) for x in c.values()]))
### BUGGY CODE ###

def main():
	n,m = map(int,input().split())
	a = list(map(int,input().split()))
	# print(a)
	exp = [(1/2 * a[0] * (a[0] +1))/a[0]]
	wa = [0,(1/2 * a[0] * (a[0] +1))/a[0]]
	for i in range(1,n):
		# print(a[i]) 
		exp.append((1/2 * a[i] * (a[i]+1))/a[i])
		wa.append(wa[i] + (1/2 * a[i] * (a[i]+1))/a[i])
	# print(exp)
	# print(len(wa))
	ans = sum(exp[0:m])
	for i in range(m,len(wa)+1):
		# print(i)
		ans = max(sum(exp[:i])-sum(exp[:i-m]),ans)
	print(ans)
	
 
if __name__ == '__main__':
	main()

### FIXED CODE ###

def main():
	n,m = map(int,input().split())
	a = list(map(int,input().split()))
	wa = [0,(1/2 * a[0] * (a[0] +1))/a[0]]
	for i in range(1,n):
		wa.append(wa[i] + (1/2 * a[i] * (a[i]+1))/a[i])
	ans = wa[m-1]
	for i in range(m,len(wa)):
		ans = max(wa[i]-wa[i-m],ans)
	print(ans)
	
 
if __name__ == '__main__':
	main()
### BUGGY CODE ###

from sys import stdin
import numpy as np
N=list(map(int,(stdin.readline().strip().split())))[0]
A=np.array(list(map(int,(stdin.readline().strip().split()))))
print(np.count_nonzero(A==1))
for i in range(2,N+1):
    print((np.count_nonzero(A==i)))


### FIXED CODE ###

from sys import stdin
import numpy as np
N=list(map(int,(stdin.readline().strip().split())))[0]
A=list(map(int,(stdin.readline().strip().split())))
num_list=[0]*N
moji=A[0]
i=0
length=len(A)-1
for i in A:
    num_list[i-1]+=1
for num in num_list:
    print(num)
### BUGGY CODE ###

def gho(x):
  g=1
  for i in range(1,x+1):
    g*=i
  return g

q,w=map(int,input().split())
e,d=divmod((2*w-q),3)
r,f=divmod((2*q-w),3)

if d!=0 or f!=0:print(0)
else:
  print((gho(e+r)//(gho(e)*gho(r)))%(10*9+7))

### FIXED CODE ###

x,y=map(int,input().split());n=0;mod=10**9+7;ans=0
if not (x+y)%3:
  n=(x+y)//3;x-=n;y-=n
  if x>=0 and y>=0:
    ans=1
    for i in range(x):ans=ans*(n-i)*pow(i+1,mod-2,mod)%mod
print(ans)
### BUGGY CODE ###

K,S=map(int,input().split())
ans=0
for X in range(K+1):
	for Y in range(K+1):
		for Z in range(K+1):
			if X+Y+Z==S:
				ans+=1
print(ans)

### FIXED CODE ###

K,S=map(int,input().split())
ans=0
for i in range(K+1):
    for j in range(K+1):
        k=S-i-j
        if k>=0 and k<=K:
            ans+=1
print(ans)
### BUGGY CODE ###

N=int(input())
S=[str(i) for i in input()]
l=[]
for i in range(10):
  for j in range(10):
    for k in range(10):
      l.append(str(i)+str(j)+str(k))

ans=0
for i in range(len(l)):
  now=l[i]
  j=0
  for s in range(N):
    if S[s]==now[j]:
      j+=1

    if j==3:
      ans+=1
      break
print(ans)


### FIXED CODE ###

n=int(input())
s=input()
ans=0

for i in range(10):
  x=s.find(str(i))
  if x!=-1:
    for j in range(10):
      y=s.find(str(j),x+1,n)
      if y!=-1:
        for k in range(10):
          z=s.find(str(k),y+1,n)
          if z!=-1:
            ans+=1
print(ans)
### BUGGY CODE ###

import math
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7

def lcm(a, b):
    return (a * b) // math.gcd(a, b)

a_lcm = 1
for i in range(n):
    a_lcm = lcm(a_lcm, a[i])

b_sum = 0
for i in range(n):
    b_sum = (b_sum + (a_lcm // a[i])) % mod

print(b_sum)


### FIXED CODE ###

import math
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7

def lcm(a, b):
    return (a * b) // math.gcd(a, b)

a_lcm = 1
for i in range(n):
    a_lcm = lcm(a_lcm, a[i])

b_sum = 0
for ai in a:
    b_sum += a_lcm // ai

print(b_sum%mod)
### BUGGY CODE ###

# import sys
# input = sys.stdin.readline
import numpy as np


def main():
    N, K = map(int, input().split())
    ps = np.array(list(input().split()), dtype=int)
    ps = (ps + 1) / 2

    m = 0
    for i in range(N):
        left = i
        right = min(i+K, N)

        s = sum(ps[left:right])
        m = max(m, s)

    print(m)


if __name__ == '__main__':
    main()


### FIXED CODE ###

# import sys
# input = sys.stdin.readline
import numpy as np


def main():
    N, K = map(int, input().split())
    ps = np.array(list(input().split()), dtype=int)
    ps = (ps + 1) / 2

    s_list = [0 for _ in range(N)]

    left = 0
    right = K
    s_list[0] = sum(ps[left:right])

    maximum = s_list[0]

    for i in range(1, N):
        left = ps[i-1]

        p_right = K + i - 1
        if p_right >= N:
            right = 0
        else:
            right = ps[p_right]

        s_list[i] = s_list[i-1] - left + right
        maximum = max(maximum, s_list[i])

    return maximum


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

from itertools import combinations

n = int(input())
l = list(map(int, input().split()))
comb = list(combinations(l,3))

ans = 0
for c in comb:
    if sum(c) - 2*max(c) > 0:
        ans += 1

print(ans)

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
l.sort()

ans = 0
for i in range(len(l)):
    right = i+1
    for left in range(i+1, len(l)):
        while right+1 < len(l) and l[right+1] < l[left] + l[i]:
            right += 1
        ans += right - left
        if right == left:
            right += 1

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

# -*- coding:utf-8 -*-
count = 0
while True:
    try:
        n = int(input())
        if n == 2:
            count += 1
        for i in range(2,n):
            if n % i == 0:
                break
            elif i == n - 1:
                count += 1
    except  EOFError:
        break
print(count)

### FIXED CODE ###

# -*- coding:utf-8 -*-
import math
count = 0
while True:
    try:
        n = int(input())
        if n == 2 or n == 3 or n == 5 or n == 7:
            count += 1
        if n > 3 and n % 2 != 0:
            for i in range(3,int(math.sqrt(n))+1):
                if n % i == 0:
                    break
                elif i == int(math.sqrt(n)):
                    count += 1
    except  EOFError:
        break
print(count)
### BUGGY CODE ###

def main():
    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])
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 ###

import itertools
N,K = map(int,input().split())
A = list(map(int,input().split()))
if K >= 1000:
    print(*[N]*N)
    exit()
for i in range(K):
    newA = [0]*N
    for j in range(N):
        newA[max(0,j-A[j])] += 1
        if j+A[j]+1 < N:
            newA[min(N-1,j+A[j]+1)] -= 1
    A = list(itertools.accumulate(newA))
    if A == [N]*N:
        break
print(*A)

### FIXED CODE ###

import itertools
N,K = map(int,input().split())
A = list(map(int,input().split()))
if K >= 50:
    print(*[N]*N)
    exit()
for i in range(K):
    newA = [0]*N
    for j in range(N):
        newA[max(0,j-A[j])] += 1
        if j+A[j]+1 < N:
            newA[min(N-1,j+A[j]+1)] -= 1
    A = list(itertools.accumulate(newA))
    if A == [N]*N:
        break
print(*A)
### BUGGY CODE ###

n,k,q=map(int,input().split())
a=[]
for _ in range(q):
  a.append(int(input()))

def minus(data):
  return data - 1

points = [k]*(n+1)
for i in range(q):
  points = list(map(minus, points))
  points[a[i]] += 1

for i in range(1,n+1):
  if points[i] >= 1:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

n,k,q=map(int,input().split())
a=[]
for _ in range(q):
  a.append(int(input()))

points = [k]*(n+1)
plus = [0]*(n+1)
for i in range(q):
  plus[a[i]] += 1

for i in range(1,n+1):
  points[i] = points[i] - q + plus[i]
  if points[i] >= 1:
    print('Yes')
  else:
    print('No')
### BUGGY CODE ###

import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 10**7+9
inf = 10**20

s = input()
q = int(input())
for i in range(q):
    l = input().split()
    if l[0]=="1":
        s = s[::-1]
    else:
        if l[1]=="1":
            s = l[2]+s
        else:
            s += l[2]

print(s)


### FIXED CODE ###

import math
import itertools
import fractions
import heapq
import collections
import bisect
import sys
import copy

sys.setrecursionlimit(10**9)
mod = 10**7+9
inf = 10**20

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


sentou = ""
matubi = ""
reverse = False
for i in range(q):
    l = input().split()
    if l[0]=="1":
        reverse = not(reverse)
    else:
        if l[1]=="1":
            if reverse:
                matubi += l[2][::-1]
            else:
                sentou = l[2] + sentou
        else:
            if reverse:
                sentou = l[2][::-1] + sentou
            else:
                matubi += l[2]
    #print(sentou,s,matubi)

if reverse:
    print(matubi[::-1] + s[::-1] + sentou[::-1])
else:
    print(sentou + s + matubi)
### BUGGY CODE ###

n = int(input())
a = list(map(int, input(). split()))
ans = 1
if a.count(0) >= 1:
  print(0)
  exit()
for i in range(n):
  ans = ans*a[i]
  if ans > 10**18:
    ans = -1
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input(). split()))
ans = 1
if a.count(0) >= 1:
  print(0)
  exit()
for i in range(n):
  ans = ans*a[i]
  if ans > 10**18:
    ans = -1
    break
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))

ans = 1
for i in range(n):
    ans *= a[i]
if ans > 10**18:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))

ans = 1
if 0 in a:
    print(0)
    exit()
for i in range(n):
    ans *= a[i]
    if ans > 10**18:
        print(-1)
        exit()
else:
    print(ans)