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

import heapq as hq
from collections import deque
n,m,s,t=map(int,input().split())
yenLinks={}
snkLinks={}
for _ in range(m):
    u,v,a,b=map(int,input().split())
    if u not in yenLinks:
        yenLinks[u]=[(v,a)]
        snkLinks[u]=[(v,b)]
    else:
        yenLinks[u].append((v,a))
        snkLinks[u].append((v,b))
    if v not in yenLinks:
        yenLinks[v]=[(u,a)]
        snkLinks[v]=[(u,b)]
    else:
        yenLinks[v].append((u,a))
        snkLinks[v].append((u,b))
#Dijkstra
INF=100000000000001
for i in range(1,n+1):
    yenDijk=[[INF,0] for _ in range(n+1)] #Distance,Determined index0 never used#
    snkDijk=[[INF,0] for _ in range(n+1)]

#yen route
pQueue=[(0,s)]
yenDijk[s]=[0,0]
hq.heapify(pQueue)

while pQueue:
    d,v = hq.heappop(pQueue)
    if yenDijk[v][1]:
        continue
    else:
        yenDijk[v][1] = 1
    for (w,D) in yenLinks[v]:
        if yenDijk[w][1]:
            continue
        else:
            if yenDijk[w][0]>yenDijk[v][0]+D:
                yenDijk[w][0] = yenDijk[v][0]+D
                hq.heappush(pQueue,(yenDijk[w][0],w))

#snuuk route
pQueue=[(0,t)]
snkDijk[t]=[0,0]
hq.heapify(pQueue)

while pQueue:
    d,v = hq.heappop(pQueue)
    if snkDijk[v][1]:
        continue
    else:
        snkDijk[v][1] = 1
    for (w,D) in snkLinks[v]:
        if snkDijk[w][1]:
            continue
        else:
            if snkDijk[w][0]>snkDijk[v][0]+D:
                snkDijk[w][0] = snkDijk[v][0]+D
                hq.heappush(pQueue,(snkDijk[w][0],w))
#OUTPUT
i = n
ans = INF
answers=[]
while i>0:
    ans = min(ans,yenDijk[i][0]+snkDijk[i][0])
    answers.append(1000000000000000-ans)
    i-=1
answers.reverse()
for ans in answers:
    print(ans)

### FIXED CODE ###

import heapq as hq
from collections import deque
n,m,s,t=map(int,input().split())
#リンク情報をつくる
yenLinks={}
snkLinks={}
for _ in range(m):
    u,v,a,b=map(int,input().split())
    if u not in yenLinks:
        yenLinks[u]=[(v,a)]
        snkLinks[u]=[(v,b)]
    else:
        yenLinks[u].append((v,a))
        snkLinks[u].append((v,b))
    if v not in yenLinks:
        yenLinks[v]=[(u,a)]
        snkLinks[v]=[(u,b)]
    else:
        yenLinks[v].append((u,a))
        snkLinks[v].append((u,b))
#Dijkstra法をする関数
INF=float('inf')
def dijkstra(start,links,nodeNum):
    ans=[INF for _ in range(nodeNum+1)]
    ans[start]=0
    PQ=[(0,start)]
    hq.heapify(PQ)
    while PQ:
        (Vd,V) = hq.heappop(PQ)
        #print([V,Vd,ans[V]])
        if Vd > ans[V]:
            continue
        for (W,D) in links[V]:
            cand = ans[V] + D
            if cand < ans[W]:
                ans[W] = cand
                hq.heappush(PQ,(ans[W],W))
            #print(PQ)
    return(ans)
#Dijkstra法実行
yenKstra=dijkstra(s,yenLinks,n)
snkKstra=dijkstra(t,snkLinks,n)
#答えを求める
i=n
ans=INF
answers=[]
while i>0:
    cand = yenKstra[i]+snkKstra[i]
    ans = min(ans,cand)
    answers.append(10**15-ans)
    i-=1
answers.reverse()
#出力
for ans in answers:
    print(ans)
### BUGGY CODE ###

from collections import deque
n = int(input())
listx = [int(input()) for i in range(n)]

listx.sort()
listx = deque(listx)
listy = deque([])
ans=0

x=listx.popleft()
listy.appendleft(x)
x=listx.pop()
listy.append(x)
ans+=int(listy[1])-int(listy[0])

for i in range(n-2):
    abs1=abs(listx[0]-listy[-1])
    abs2=abs(listx[-1]-listy[0])

    if abs1 < abs2:
        x=listx.pop()
        listy.appendleft(x)
        ans+=abs2

    else:
        x=listx.popleft()
        listy.append(x)
        ans+=abs1
        
    if listy[0] > listy[-1]:
        listy.reverse()

print(ans)


### FIXED CODE ###

import itertools
import numpy as np
data_num = int(input()) 
data = [int(input()) for i in range(data_num)] 
#data_num=5
#data=[6,8,1,2,3]

data.sort()
npdata=np.array(data)

parts1=[1]
parts2=[2 for i in range(data_num-2)]
parts1.extend(parts2)
parts1.append(1)
npparts1=np.array(parts1)

parts0=[(-1)**(i+1) for i in range(data_num)]
npparts0=np.array(parts0)

y=npparts1*npparts0

y=y.tolist()
y.sort()

y=np.array(y)
z1=sum(data*y)

parts01=[(-1)**i for i in range(data_num)]
npparts0=np.array(parts01)

y=npparts1*npparts0

y=y.tolist()
y.sort()
y=np.array(y)
z2=sum(data*y)

print(max(z1,z2))
### BUGGY CODE ###

import sys
from fractions import gcd
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    A=list(map(int,input().split()))
    l=A[0]
    c=0
    for x in A[1:]:
        l=l*x//gcd(l,x)
    c+=l//MOD
    l%=MOD
    ans=0
    for x in A:
        ans+=l//x
        ans+=MOD//x*c
        ans+=(MOD%x*c+l%x)//x
        ans%=MOD
    print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
from fractions import gcd
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    def modinv(a, mod):
        b,u,v = mod,1,0
        while b:
            t=a//b
            a-=t*b
            a,b=b,a
            u-=t*v
            u,v=v,u
        u%=mod
        if u < 0:
            u+=mod
        return u
    
    
    N=int(input())
    A=list(map(int,input().split()))
    l=A[0]
    for x in A[1:]:
        l=l*x//gcd(l,x)
    l%=MOD
    ans=0
    for x in A:
        ans+=l*modinv(x,MOD)
        ans%=MOD
    print(ans)

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

a = input()
a_list = list(map(int, input().split()))

a_list = sorted(a_list, reverse=True)

ans_list = [0,0]

for i in a_list:
    if ans_list == [0,0] and a_list.count(i) >= 4:
        ans_list = [i,i]
        break
    elif a_list.count(i) >= 2 and ans_list[0] == 0:
        ans_list[0] = i
    elif a_list.count(i) >= 2 and ans_list[0] > i and ans_list[1] == 0:
        ans_list[1] = i
        break

print(ans_list[0]*ans_list[1])
        

### FIXED CODE ###

from collections import Counter

a = input()
a_list = list(map(int, input().split()))
 
# 要素数の数え上げと取り出し
num_counter = Counter(a_list)
num_keys = sorted(num_counter.keys(), reverse=True)

big = 0
small = 0

for i in num_keys:
  x = num_counter[i]
  if x >= 4:
    if big == 0:
      big = small = i
    elif big != 0 and small == 0:
      small = i
  elif x == 3 or x == 2:
    if big == 0:
      big = i
    elif big != 0 and small == 0:
      small = i
  if big != 0 and small != 0:
    break
print(big * small)
### BUGGY CODE ###

from queue import Queue
H, W = map(int,input().split())
MAP = []
for _ in range(H):
    MAP.append(list(input()))
tx = [1,0,-1,0]
ty = [0,1,0,-1]
cnt = 0
for i in range(H):
    for j in range(W):
        if MAP[i][j] == '#':
            cnt += 1
q = Queue()
q.put([0,0,1])
while True:
    x, y, index = q.get()
    MAP[x][y] = '#'
    if x == H - 1 and y == W - 1:
        cnt += index
        break
    for i in range(4):
        nx = x + tx[i]
        ny = y + ty[i]
        if 0 <= nx <= H-1 and 0 <= ny <= W-1 and MAP[nx][ny] == '.':
            q.put([nx,ny,index+1])

ans = H * W - cnt
print(ans)

### FIXED CODE ###

from queue import Queue
H, W = map(int,input().split())
MAP = []
for _ in range(H):
    MAP.append(list(input()))
tx = [1,0,-1,0]
ty = [0,1,0,-1]
cnt = 0
INF = 10 ** 8
for i in range(H):
    for j in range(W):
        if MAP[i][j] == '#':
            cnt += 1
d = [[INF for i in range(W)] for j in range(H)]
q = Queue()
q.put([0,0])
d[0][0] = 1
flag = 1
while not q.empty():
    x, y = q.get()
    if x == H - 1 and y == W - 1:
        flag = 0
        break
    for i in range(4):
        nx = x + tx[i]
        ny = y + ty[i]
        if 0 <= nx <= H-1 and 0 <= ny <= W-1 and MAP[nx][ny] == '.' and d[nx][ny] == INF:
            d[nx][ny] = d[x][y] + 1
            q.put([nx,ny])
if flag:
    print(-1)
else:
    ans = H * W - d[H-1][W-1] - cnt
    print(ans)
### BUGGY CODE ###


h, w, m = map(int, input().split())

mp = set()
hp = [0] * h
wp = [0] * w

for i in range(m):
    a, b = map(int, input().split())
    mp.add((a,b))
    l = [a, b]
    hp[l[0]-1] += 1
    wp[l[1]-1] += 1

hpdex = [i for i, x in enumerate(hp) if x == max(hp)]
wpdex = [i for i, x in enumerate(wp) if x == max(wp)]

for i in hpdex:
    for j in wpdex:
        if (i+1, j+1) not in mp:
            print(max(hp) + max(wp))
            exit()

print(max(hp) + max(wp) - 1)

### FIXED CODE ###

h, w, m = map(int, input().split())

mp = set()
hp = [0] * h
wp = [0] * w

for i in range(m):
    a, b = map(int, input().split())
    mp.add((a, b))
    l = [a, b]
    hp[l[0]-1] += 1
    wp[l[1]-1] += 1

maxhp = max(hp)
maxwp = max(wp)
hpdex = [i for i, x in enumerate(hp) if x == maxhp]
wpdex = [i for i, x in enumerate(wp) if x == maxwp]

for i in hpdex:
    for j in wpdex:
        if (i+1, j+1) not in mp:
            print(max(hp) + max(wp))
            exit()

print(max(hp) + max(wp) - 1)
### BUGGY CODE ###

import itertools
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(min(k,32)):
  
  imos=[0]*(n+1)
  for j in range(n):
    imos[max(j-a[j],0)]+=1
    imos[min(j+a[j]+1,n)]-=1
  a=list(itertools.accumulate(imos))
  
  if a[:n]==[n]*n:
    break
print(*a[:n]) 


### FIXED CODE ###

import itertools
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(min(k,50)):
  imos=[0]*(n+1)
  for j in range(n):
    imos[max(j-a[j],0)]+=1
    imos[min(j+a[j]+1,n)]-=1
  a=list(itertools.accumulate(imos))
  if a[:n]==[n]*n:
    break
    
print(*a[:n])
### BUGGY CODE ###

n = int(input())
s = 0
for i in range(1, n+1):
    ii = str(i)
    for j in range(int(ii[0]), n+1, 10):
        jj = str(j)
        if ii[0] == jj[-1] and ii[-1] == jj[0]:
            s+=1
print(s)

### FIXED CODE ###

n = int(input())
cif = [[0]*10 for i in range(10)]

for i in range(1, n+1):
    s = str(i)
    f = int(s[0])
    r = int(s[-1])
    cif[f][r] += 1
res = 0

for i in range(10):
    for j in range(10):
        res += cif[i][j]*cif[j][i]
print(res)
### BUGGY CODE ###

from functools import reduce
A, B =  map(int, (input().split(' ')))

def xor_sum(A,B):
    bins = [i for i in range(A, B+1)]
    return reduce(xor, bins)
def xor(A,B):
    return A ^ B

print(xor_sum(A,B))

### FIXED CODE ###

from functools import reduce
A, B =  map(int, (input().split(' ')))

def xor_sum(A,B):
        
    if A%2 == 0:
        if B%2 == 1:
            if (B - A + 1) // 2 % 2 == 0:
                hoge = 0
            if (B - A + 1) // 2 % 2 == 1:
                hoge = 1
            print(hoge)
        else:
            if (B - A + 1 - 1) // 2 % 2 == 0:
                hoge = 0
            if (B - A + 1 - 1) // 2 % 2 == 1:
                hoge = 1
            print(hoge ^ B)
    else:
        if B%2 == 0:
            if (B - A + 1 - 2) // 2 % 2 == 0:
                hoge = 0
            if (B - A + 1 - 2) // 2 % 2 == 1:
                hoge = 1
            print((A ^ hoge) ^ B)
        else:
            if (B - A + 1 - 1) // 2 % 2 == 0:
                hoge = 0
            if (B - A + 1 - 1) // 2 % 2 == 1:
                hoge = 1
            print(A ^ hoge)
            
xor_sum(A, B)
### BUGGY CODE ###

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

P = list(map(int,input().split()))

def calc_e(p):
    temp = 0
    for i in range(1, p + 1):
        temp += i * (1 / p)
    return temp

temp_max = 0
temp_i = 0

for i in range(N - K + 1):
    temp = sum(P[i:i+K])
    if temp_max <= temp:
        temp_max = temp
        temp_i = i


temp = 0
for i in range(temp_i,temp_i + K):
    temp += calc_e(P[i])
print(temp)

### FIXED CODE ###


N,K = list(map(int,input().split()))
line = list(map(int,input().split()))

temp_num = sum(line[0:K])
temp_max = temp_num

for i in range(N - K):
    temp_num = temp_num - line[i] + line[i + K]
    if temp_num > temp_max:
        temp_max = temp_num


print((temp_max + K) / 2)
### BUGGY CODE ###

#AGC030 B - Powers of two
beki=[]
for i in range(1,32):
    beki.append(2**i)#bekiは２のべき乗の配列
N=int(input())
A=input().split()
for i in range(N):
    A[i]=int(A[i])
for i in (reversed(beki)):
    inverseA=[]
    for j in range(len(A)):
        inverseA.append(i-A[j])#inverseA
    for j in range(len(A)):
        if inverseA[j] in A:
            A.remove(inverseA[j])
print((N-len(A))//2)

### FIXED CODE ###

#AGC030 B - Powers of two
import collections
import math
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
cnter=collections.Counter(A)
ans=0
for a in A:
    inv=2**(int(math.log2(a))+1)
    if cnter[a]==0:
        continue
    if inv==2*a and cnter[inv-a]<=1:
      	continue
    if cnter[inv-a]>0:
        cnter[inv-a]=cnter[inv-a]-1
        cnter[a]=cnter[a]-1
        ans=ans+1
print(ans)
### BUGGY CODE ###

r,g,b,n = map(int,input().split())
r_max,g_max,b_max = int(n/r),int(n/g),int(n/b)
ans = 0
for i in range(0,r_max+1):
  for j in range(0,g_max+1):
    for k in range(0,b_max+1):
      if i*r+j*g+b*k == n:
        ans+=1  
print(ans)

### FIXED CODE ###

import itertools
r,g,b,n = map(int,input().split())
r_max,g_max,b_max = int(n/r),int(n/g),int(n/b)
ans = 0
for i,j in itertools.product(range(0,r_max+1),range(0,g_max+1)):
  if (n - (i*r+j*g))%b == 0 and n - (i*r+j*g) >= 0:
    ans+=1
print(ans)
### BUGGY CODE ###

n, a, b = map(int, input().split())

array = []

for t in range(10 ** 100):
    for p in range(a):
        array.append('blue')
    for q in range(b):
        array.append('red')
    if len(array) > n:
        break
    
x = 0

for i in range(n):
    if array[i] == 'blue':
        x += 1

print(x)

### FIXED CODE ###

n, a, b = map(int, input().split())

f = n // (a+b)
g = n % (a+b)

if g <= a:
    print(a * f + g)
    
else:
    print(a * (f+1))
### BUGGY CODE ###

a,b=map(int,input().split())
ne=[]
po=[]
for i in range(a,b+1):
    if i<0:
        ne.append(i)
    if i>0:
        po.append(i)
    if i==0:
        print("Zero")
        exit()
if len(po)==0:
    print("Positive" if len(ne)%2==0 else "Negative")
else:
    print("Positive")

### FIXED CODE ###

a,b=map(int,input().split())
if a>=0:
    print("Positive" if a!=0 else "Zero")
if a<0 and b>0:
    print("Zero")
if b<=0:
    if b==0:
        print("Zero")
    else:
        if (a-b+1)%2==0:
            print("Positive")
        else:
            print("Negative")
### BUGGY CODE ###

# E - Colorful Blocks
import sys
readline = sys.stdin.readline

MOD = 998244353
N, M, K = map(int, readline().split())

def pow_mod(x, n, mod):
    ans = 1
    while n>0:
        if n&1==1:
            ans = (ans * x)%mod
        x = (x * x)%mod
        n >>= 1
    return ans

f = [1]
for i in range(N):
    f.append(f[i]*(i+1)%MOD)

def comb_mod(n, r, p):
    return (f[n] * pow_mod(f[r], p-2, p) * pow_mod(f[n-r], p-2, p))%p

ans = 0
for i in range(K+1):
    ans = (ans + (M*pow_mod(M-1, N-1-i, MOD)) * comb_mod(N-1, i, MOD))%MOD

print(ans)


### FIXED CODE ###

# E - Colorful Blocks

MOD = 998244353
N, M, K = map(int, input().split())

# 予め階乗を計算しておく
f = [1]
for i in range(N):
    f.append(f[i]*(i+1)%MOD)

# 組み合わせ関数
def comb_mod(n, r, p):
    return f[n] * pow(f[r], p-2, p) * pow(f[n-r], p-2, p)

ans = 0
for i in range(K+1):
    ans = (ans + (M*pow(M-1, N-1-i,MOD)) * comb_mod(N-1, i, MOD))%MOD

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

import math

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

R, G, B = [], [], []

for i in range(len(s)):
    if s[i] == "R": R.append(i + 1)
    if s[i] == "G": G.append(i + 1)
    if s[i] == "B": B.append(i + 1)

cnt = 0
for r in R:
    for g in G:
        for b in B:
            i, j, k = sorted([r, g, b])
            if j - i != k - j:
                cnt += 1

print(cnt)


### FIXED CODE ###

import math

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

R, G, B = s.count("R"), s.count("G"), s.count("B")
ans = R * G * B

for i in range(n):
    for j in range(n):
        c1 = i
        c2 = i + j
        c3 = i + j * 2
        if c3 >= n: continue
        if c1 == c2 == c3: continue
        if s[c1] != s[c2] and s[c2] != s[c3] and s[c1] != s[c3]:
            ans -= 1

print(ans)
# 012 024 036 048
# 123 135 147 159
### BUGGY CODE ###

N = int(input())
P = [int(x) for x in input().split()]
count = 0
check = 0
for i in range(N):
    check = 0
    for j in range(i):
        if P[i] <= P[j]:
            check += 1
    if check == i:
        count += 1

print(count)


### FIXED CODE ###

N = int(input())
P = [int(x) for x in input().split()]
count = 0
check = 0
min = 10**9
for i in P:
    check = 0
    if min > i:
        min = i
    if i <= min:
        count += 1

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

n = int(input())
ans = 0
cnt = 0
while n>0:
    ans += n%10
    n //= 10
if ans%9 == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n = str(input())
ans = 0
for i in range(len(n)):
    ans += int(n[i])
if ans%9 == 0:
    print("Yes")
else:
    print("No")
### BUGGY CODE ###

from functools import reduce

def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

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

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

def main():
    N = int(input())
    A = list(map(int, input().split()))
    D = lcm_list(A)
    ans = 0
    MOD = 10 ** 9 + 7
    for a in A:
        ans += D // a
        ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

from fractions import gcd
from functools import reduce


def lcm_base(x, y):
    return (x * y) // gcd(x, y)

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

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

def main():
    N = int(input())
    A = list(map(int, input().split()))
    D = lcm_list(A)
    ans = 0
    MOD = 10 ** 9 + 7
    D %= MOD
    for a in A:
        ans += D * pow(a, MOD - 2, MOD)
        ans %= MOD
    print(ans)


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

import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    N = I()
    H = N // 3
    min_num = -float('inf')
    #dpの初期化
    dp = [[min_num for j in range(H+1)] for i in range(N+1)]
    dp[0][0] = 1
    res = 0
    
    mod=10 ** 9 + 7
    
    for i in range(1, H+1):
        for j in range(3*i, N+1):
            for k in range(3, j+1):
                if dp[j][i] == min_num:
                    if dp[j-k][i-1] != min_num:
                        dp[j][i] = dp[j-k][i-1] % mod
                else:
                    if dp[j-k][i-1] != min_num:
                        dp[j][i] += (dp[j-k][i-1] % mod)

    for num in dp[N]:
        if num != min_num:
            res += (num % mod)
    print(res % mod)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    N = I()
    #dpの初期化
    dp = [0]*(N+1)
    dp[0] = 1
    
    mod=10 ** 9 + 7
    
    for i in range(3, N+1):
        dp[i] = (dp[i-1]+dp[i-3]) % mod
        
    print(dp[N])

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

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

x = [N]
i = 0
while True:
    N = abs(N-K)
    x.append(N)
    i += 1
    if x[i-1] <= x[i]:
        break
print(min(x))

### FIXED CODE ###

#coding:utf-8

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

r1 = n % k
r2 = abs(k - r1)

ans = min(r1,r2)

print("{}".format(ans))
### BUGGY CODE ###

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


### FIXED CODE ###

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

n,m,x = map(int,input().split())
a = [0]*n
for i in range(n):
    a[i] = list(map(int,input().split()))
    
import itertools
data = list(range(n))
r = n
cc = list(itertools.permutations(data, r))

count = 0
ans = 10**7
for s in cc:
    count = 0
    sw = [0]*m
    for j in range(len(s)):
        
        for i in range(m):
            sw[i] += a[s[j]][i+1]
        count += a[s[j]][0]
        if count >= ans:
            break
        q = 1
        for k in range(m):
            if sw[k] < x:
                q = 0
                break
        if q == 1:
            ans = min(ans,count)
            break
if ans == 10**7:
    print(-1)
else:
    print(ans)


### FIXED CODE ###

n,m,x = map(int,input().split())
a = [0]*n
for i in range(n):
    a[i] = list(map(int,input().split()))
ans = 10**7
for i in range(2**n):
    count = 0
    sw = [0]*m
    for j in range(n):
        if (i>>j)&1:
            count += a[j][0]
            for k in range(m):
                sw[k] += a[j][k+1]
    q = 1
    for L in range(m):
        if sw[L] < x:
            q = 0
            break
    if q == 1:
        ans = min(ans,count)
if ans == 10**7:
    print(-1)
else:
    print(ans)
### BUGGY CODE ###

from collections import Counter

N = int(input())
S = [Counter(input()) for _ in range(N)]

ans = 0
T = []
ans = [1]*N
for i in range(N):
    if S[i] in T:
        p = T.index(S[i])
        ans[p] += 1
    else:
        T.append(S[i])

pp = 0
for i in ans:
    pp += (i-1)*i//2

print(pp)


### FIXED CODE ###

from collections import Counter, defaultdict

N = int(input())
S = [Counter(input()) for _ in range(N)]

dd = defaultdict(int)

for i in S:
    p = 0
    for j in i:
        p += 26**(ord(j)-ord('a'))*(i[j])
    dd[p] += 1

ans = 0
a = dd.keys()
for i in a:
    ans += (dd[i]-1)*dd[i]//2
print(ans)
### BUGGY CODE ###

def abs(x):
    if x>0:
        return x
    else:
        return x * (-1)

if __name__ == '__main__':
    n = int(input())
    a = list(map(int, input().split()))
    a_mi = list(a[idx] - idx for idx in range(len(a)))

    s = float('inf')
    for b in range(min(a_mi), max(a_mi) + 1):
        s = min(s, sum(abs(x - b) for x in a_mi))
    print(s)

### FIXED CODE ###

N = int(input())
A = map(int, input().split())
B = list(A_i - (i + 1) for i, A_i in enumerate(A))
B_sorted = sorted(B)

ans = []
##中央値のインデックスmを求める
if N % 2 == 1:
    ##Nが奇数: 中央値のインデックスを求める
    m = int((N - 1) / 2 + 1) - 1
    b = B_sorted[m]
    ans += [sum(abs(x - b) for x in B_sorted)]
else:
    ##Nが偶数: 中央値を計算する元になる2数のインデックスを求める
    for m in range(int(N / 2) - 1, int(N / 2) + 1):
        b = B_sorted[m]
        ans += [sum(abs(x - b) for x in B_sorted)]    
print(min(ans))
### BUGGY CODE ###

import sys
import itertools

n = int(sys.stdin.readline())
MM = [list(map(int, sys.stdin.readline().split())) for _ in range(n)]

amin=1000000000000
for t in itertools.permutations(range(n-1)):
    mm=[m[:] for m in MM]
    o = list(t)
    ans=0
    for _ in range(n-1):
        i = o.pop(0)
        ans += mm[i][0]*mm[i+1][1]*mm[i][1]

        mm[i][1] = mm[i+1][1]
        mm.pop(i+1)
        
        for j in range(len(o)):
            if o[j]>i: o[j] -=1

    if amin>ans: amin=ans


print(amin)


### FIXED CODE ###

import sys

n = int(sys.stdin.readline())

m = list(map(int, sys.stdin.readline().split()))
for _ in range(n-1):
    _, a = sys.stdin.readline().split()
    m.append(int(a))

c = [[-1 for _ in range(n)] for _ in range(n)]

def val(a, b):
    if a==b: return 0
    if c[a][b]>0: return c[a][b]
    c[a][b]=val(a+1,b)+m[a-1]*m[a]*m[b]
    for k in range(a+1, b):
        v=val(a,k)+val(k+1,b)+m[a-1]*m[k]*m[b]
        if c[a][b]>v: c[a][b]=v
    return c[a][b]

print(val(0, n-1))