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

import sys
a, b, c, k = map(int, input().split())
max = 0
if a < k:
    for i in range(a, -1, -1):
        for j in range(b, -1, -1):
            for l in range(c+1):
                if i+j+l == k:
                    print(i-l)
                    sys.exit()
else:
    for i in range(k, -1, -1):
        for j in range(b, -1, -1):
            for l in range(c+1):
                if i+j+l == k:
                    print(i-l)
                    sys.exit()

### FIXED CODE ###

import sys
a, b, c, k = map(int, input().split())
if a >= k:
    print(k)
    sys.exit()
else:
    if b >= k-a:
        print(a)
        sys.exit()
    else:
        print(a-(k-a-b))
        sys.exit()
### BUGGY CODE ###

from collections import defaultdict,deque
def hash(x,y):
    x,y =min(x,y),max(x,y)
    return x*(N+1)+y
s = set()
N = int(input())
edge = [[] for _ in range(N*N+N)]
ind = [0]*(N*N+N)
for i in range(1,N+1):
    A = list(map(int,input().split()))
    s.add(hash(i,A[0]))
    for j in range(N-1):
        for k in range(j+1,N-1):
            edge[hash(i,A[j])].append(hash(i,A[k]))
            ind[hash(i,A[k])] += 1
d = deque()
nd = deque()
for hash in s:
    if ind[hash] == 0:
        d.append(hash)
ans = 0
finished = 0
while d:
    while d:
        hash = d.popleft()
        finished += 1
        for nhash in edge[hash]:
            ind[nhash] -= 1
            if ind[nhash] == 0:
                nd.append(nhash)
    d = nd
    nd = deque()
    ans += 1
if finished == N*(N-1)//2:
    print(ans)
else:
    print(-1)

### FIXED CODE ###

from collections import defaultdict,deque
def hash(x,y):
    x,y =min(x,y),max(x,y)
    return x*(N+1)+y
s = set()
N = int(input())
edge = [[] for _ in range(N*N+N)]
ind = [0]*(N*N+N)
for i in range(1,N+1):
    A = list(map(int,input().split()))
    s.add(hash(i,A[0]))
    for j in range(N-2):
            edge[hash(i,A[j])].append(hash(i,A[j+1]))
            ind[hash(i,A[j+1])] += 1
d = deque()
nd = deque()
for hash in s:
    if ind[hash] == 0:
        d.append(hash)
ans = 0
finished = 0
while d:
    while d:
        hash = d.popleft()
        finished += 1
        for nhash in edge[hash]:
            ind[nhash] -= 1
            if ind[nhash] == 0:
                nd.append(nhash)
    d = nd
    nd = deque()
    ans += 1
if finished == N*(N-1)//2:
    print(ans)
else:
    print(-1)
### BUGGY CODE ###

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

mod = 998244353
g1 = [1, 1]
g2 = [1, 1]
inv = [0, 1]

for i in range(2, N+1):
  g1.append((g1[-1] * i) % mod)
  inv.append((-inv[mod % i] * (mod//i)) % mod)
  g2.append((g2[-1] * inv[-1]) % mod)

def cmb(n, r):
  if r < 0 or r > n:
    return 0
  r = min(r, n-r)
  return g1[n] * g2[r] * g2[n-r] % mod

ans = 0
for x in range(N+1):
  rest = K - A*x
  if rest % B == 0:
    y = rest // B
    for g in range(max(0, x+y-N), min(x,y)+1):
      r = x - g
      b = y - g
      ans += cmb(N, r) * cmb(N-r, g) * cmb(N-r-g, b) % mod

print(ans % mod)

### FIXED CODE ###

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

MOD = 998244353
factorials = [1]
inv_facts = [1]
for i in range(1, N+1):
    factorials.append(factorials[-1] * i % MOD)
    inv_facts.append(inv_facts[-1] * pow(i, MOD-2, MOD) % MOD)

def combi(n, k):
    ret = factorials[n]
    ret *= inv_facts[k]
    ret %= MOD
    ret *= inv_facts[n-k]
    ret %= MOD
    return ret

ans = 0
for a in range(N+1):
    rest = K - (A * a)
    if rest < 0:
        break
    if rest % B == 0:
        b = rest // B
        if b <= N:
            tmp = combi(N, a) * combi(N, b) % MOD
            ans += tmp
            ans %= MOD
print(ans)
### BUGGY CODE ###

import numpy as np
import math as m

def main(**kwargs):
    front = ""
    back = ""
    front_i = ""
    back_i = ""
    now = "f"

    for q in qs:
        if q[0] == "1":
            if now == "b":
                now = "f"
            else:
                now = "b"
        else:
            if (q[1] == "1" and now == "f") or (q[1] == "2" and now == "b"):
                front += q[2]
                front_i = q[2] + front_i
            else:
                back += q[2]
                back_i = q[2] + back_i

    if now == "f":
        res = front_i + s + back
    else:
        res = back_i + s[::-1] + front
        
    return res

if __name__ == "__main__":
    cin = np.array(input().split(" "))
    s, *_ = cin
    cin = np.array(input().split(" ")).astype("int")
    n, *_ = cin

    qs = []

    for i in range(n):
        cin = np.array(input().split(" "))
        qs.append(list(cin))
    
    cout = main(s=s, n=n, qs=qs)
    print(cout)


### FIXED CODE ###

import numpy as np
import math as m
import collections

def main(**kwargs):
    front = collections.deque()
    back = collections.deque()
    now = "f"

    for q in qs:
        if q[0] == "1":
            if now == "b":
                now = "f"
            else:
                now = "b"

    if now == "f":
        now = "f"

        for q in qs:
            if q[0] == "1":
                if now == "b":
                    now = "f"
                else:
                    now = "b"
            else:
                if (q[1] == "1" and now == "f") or (q[1] == "2" and now == "b"):
                    front.appendleft(q[2])
                else:
                    back.append(q[2])

        res = "".join(front) + s + "".join(back)
    else:
        now = "f"

        for q in qs:
            if q[0] == "1":
                if now == "b":
                    now = "f"
                else:
                    now = "b"
            else:
                if (q[1] == "1" and now == "f") or (q[1] == "2" and now == "b"):
                    front.append(q[2])
                else:
                    back.appendleft(q[2])
        res = "".join(back) + s[::-1] + "".join(front)
        
    return res

if __name__ == "__main__":
    cin = np.array(input().split(" "))
    s, *_ = cin
    cin = np.array(input().split(" ")).astype("int")
    n, *_ = cin

    qs = []

    for i in range(n):
        cin = np.array(input().split(" "))
        qs.append(list(cin))
    
    cout = main(s=s, n=n, qs=qs)
    print(cout)
### BUGGY CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()))
P = [1]
for i in range(len(A)):
    if i == 0:
        P.append(A[i])
    else:
        P.append(P[-1]*A[i])
L = []
for i in range(K,N+1):
    L.append(P[i]//P[i-K])


for i in range(len(L)-1):
    if L[i] < L[i+1]:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()))
for i in range(K,N):
    if A[i-K] < A[i]:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

from collections import deque

def isPa(w,k,p):
    counter = 0
    s = 0
    n = 1
    wlen = len(w)
    while(True):
        if( sum(w[s:s+n]) > p):
            s = s+n-1
            n = 1
            counter += 1
        else:
            if( s+n == wlen):
                counter += 1
                break
            n += 1
    if(counter > k):
        return False
    else:
        return True
    
def MaxInP(w,k,p):
    maxinp = 0
    tmp = 0
    d = deque(w)
    while(d):
        tmp += d.popleft();
        if(tmp > p):
            if(tmp > maxinp):
                maxinp = tmp
            tmp = 0
    return maxinp

n,k = [int(x) for x in input().split()]
w = []
for i in range(n):
    w.append(int(input()))
    
mean = int(sum(w)/k)
maxinp = MaxInP(w,k,mean)

if k == 1:
    print(mean)
else:
    minP = mean
    maxP = maxinp
    while(True):
        m = int ((minP + maxP)/2)
        if ( isPa(w,k,m) ):
            maxP = m
        else:
            minP = m
        if (minP+1 == maxP):
            print(maxP)
            break

### FIXED CODE ###

from collections import deque

def isPa(w,k,p):
    tr = 0
    c = 0
    d = deque(w)
    while(d):
        tmp = d.popleft()
        if(tmp > p):
            return False
        
        if( tr + tmp > p):
            tr = tmp
            c += 1
        else:
            tr += tmp
        if c+1>k:
            return False
    return True

def MaxInP(w,k,p):
    maxinp = 0
    tmp = 0
    d = deque(w)
    while(d):
        tmp += d.popleft();
        if(tmp > p):
            if(tmp > maxinp):
                maxinp = tmp
            tmp = 0
    return maxinp

n,k = [int(x) for x in input().split()]
w = deque()
for i in range(n):
    w.append(int(input()))
    
mean = int(sum(w)/k)
maxinp = MaxInP(w,k,mean)

if k == 1:
    print(mean)
else:
    minP = mean
    maxP = maxinp
    while(True):
        m = int ((minP + maxP)/2)
        if ( isPa(w,k,m) ):
            maxP = m
        else:
            minP = m
        if (minP+1 == maxP or minP == maxP):
            print(maxP)
            break
### BUGGY CODE ###

N, Q = map(int, input().split())
S = input()
for x in range(Q):
    a, b = map(int, input().split())
    s1 = S[a-1:b]
    s2 = s1.replace('AC', '')
    print(int((len(s1) - len(s2)) / 2))

### FIXED CODE ###

from itertools import accumulate

N, Q = map(int, input().split())
S = input()
lst = [0]
idx = 0
for x in range(len(S) - 1):
    if S[x] == 'A' and S[x + 1] == 'C':
        lst.append(1)
    else:
        lst.append(0)

lst2 = list(accumulate(lst))
for x in range(Q):
    a, b = map(int, input().split())
    print(lst2[b-1] - lst2[a-1])
### BUGGY CODE ###

N,K,*A = map(int,open(0).read().split())

for k in range(K):
    if all(A) == N:
        break
    B = [0] * N
    for n in range(N):
        L = max(0, n-A[n])
        R = min(N-1 , n + A[n])
        B[L] += 1
        if R+1 != N:
            B[R+1] -= 1
    
    ruiseki = [0] * N
    ruiseki[0] = B[0]
    for i in range(1,N):
        ruiseki[i] = ruiseki[i-1] + B[i]
        
    A = ruiseki[:]
print(*ruiseki,sep=" ")    
   

### FIXED CODE ###

from itertools import accumulate
#from operator import add

N,K = map(int,input().split())
A = map(int,input().split()) 
for k in range(K):
    B = [0] * N
    for i,x in enumerate(A):
        L = max(0, i-x)
        R = min(N-1, i+x)
        B[L] += 1
        if R+1 != N:
            B[R+1] -= 1
    #L = accumulate(B,add) 
    L = list(accumulate(B))[:]
    if L == A:
        break
    A = L
print(*A)
### BUGGY CODE ###

from itertools import combinations
from operator  import mul
from functools import reduce
from collections import Counter
class Osa_k:
    def __init__(self, n_max):
        self.n_max = n_max
        self.min_factor = min_factor = list(range(n_max + 1))
        min_factor[2::2] = [2] * (n_max // 2)
        min_factor[3::6] = [3] * ((n_max + 3) // 6)
        for i in range(5, int(n_max ** .5) + 1, 2):
            if min_factor[i] == i:
                for j in range(i*i, n_max + 1, i):
                    if min_factor[j] == j:
                        min_factor[j] = i

    def __call__(self, n):
        min_factor = self.min_factor
        n_twoes = (n & -n).bit_length() - 1
        res = [2] * n_twoes
        n >>= n_twoes
        resappend = res.append
        while n > 1:
            p = min_factor[n]
            resappend(p)
            n //= p
        return res
    
    def div(self, n):
        factors = self.__call__(n)
        res = {1, n}
        for i in range(1, len(factors)):
            for j in combinations(factors, i):
                res |= {reduce(mul, j)}
        return res

if __name__ == "__main__":
    n, *a = map(int, open(0).read().split())
    b, c = set(a), Counter(a)
    P = Osa_k(10**6)
    cnt = 0
    for i in b:
        if c[i] > 1:continue
        for d in P.div(i):
            if d != i and d in b:break
        else:cnt += 1
    print(1 if n == 1 else cnt)

### FIXED CODE ###

#!/usr/bin/env python3
from collections import Counter
n, *A = map(int, open(0).read().split())
A.sort()
c, s = Counter(A), set()
M = max(A) + 1
ans = 0
for a in A:
    if a in s:
        continue
    ans += c[a] == 1
    for i in range(a, M, a):
        s.add(i)
print(ans)
### BUGGY CODE ###

#https://atcoder.jp/contests/abc110/tasks/abc110_c

s = list(str(input()))
t = list(str(input()))
flag = 'Yes'
jskip = []
for i in range(len(s)):
    f = True
    for j in range(len(jskip)):
        if jskip[j] == s[i]:
            f = False
            break
    if f == True:
        for j in range(i+1, len(s)):
            if s[i] == s[j] and t[i] != t[j]:
                flag = 'No'
                break
            elif t[i] == t[j] and s[i] != s[j]:
                flag = 'No'
                break
            elif s[i] == s[j] and t[i] == t[j]:
                jskip.append(s[i])
    if flag == 'No':
        break

print(flag)


### FIXED CODE ###

import sys
s = str(input())
t = str(input())
l = len(s)
tmp = [[], []]
for i in range(l):
    if (not s[i] in tmp[0]) and (not t[i] in tmp[1]):
        tmp[0].append(s[i])
        tmp[1].append(t[i])
    else:
        if s[i] in tmp[0]:
            tmp2 = 0
            for j in range(len(tmp[0])):
                if s[i] == tmp[0][j]:
                    tmp2 = j
            if t[i] != tmp[1][tmp2]:
                print('No')
                sys.exit()
        else:
            print('No')
            sys.exit()
print('Yes')
### BUGGY CODE ###

from collections import deque

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

fri = [[] for _ in range(n+1)]
blo = [[] for _ in range(n+1)]

for i in range(m):
    a, b = map(int, input().split())
    fri[a].append(b)
    fri[b].append(a)

for i in range(k):
    a, b = map(int, input().split())
    blo[a].append(b)
    blo[b].append(a)


gru = [-1] * (n+1)
gru[0] = 0
gru[1] = 0

nosa = 1
nowgru = 0
grouplist = [[] for _ in range(n+1)]
grouplist[nowgru].append(nosa)
while True:

    d = deque()
    d.append(nosa)

    while d:
        v = d.popleft()
        for i in fri[v]:
            if gru[i] != -1:
                continue
            gru[i] = nowgru
            d.append(i)
            grouplist[nowgru].append(i)

    nowgru +=1
    if -1 in gru:
        nosa = gru.index(-1)
    else:
        break


for i in range(1,n+1):
    print(len(set(grouplist[gru[i]])-set(fri[i])-set(blo[i])-set([i])))

### FIXED CODE ###

from collections import deque

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

fri = [[] for _ in range(n+1)]
blo = [[] for _ in range(n+1)]

for i in range(m):
    a, b = map(int, input().split())
    fri[a].append(b)
    fri[b].append(a)

for i in range(k):
    a, b = map(int, input().split())
    blo[a].append(b)
    blo[b].append(a)


gru = [-1] * (n+1)
gru[0] = 0
visited = [False]*(n+1)
D = {}

for root in range(1,n+1):
    if visited[root]:
        continue
    
    D[root]= set([root])
    d = deque()
    d.append(root)
    while d:
        v = d.popleft()
        visited[v] = True
        gru[v] = root
        for to in fri[v]:
            if visited[to]:
                continue
            D[root].add(to)
            d.append(to)


nans = [0]*n
for i in range(1,n+1):
    g = D[gru[i]]
    ans = len(g)-len(fri[i])-1
    for b in blo[i]:
        if b in g:
            ans -= 1
    nans[i-1] = ans

print(*nans, sep='\n')
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n, k = map(int, input().split())
a = [int(x)-1 for x in input().split()]
ans = 0
if a[0] != 0:
    ans += 1
    a[0] = 0

g = [[] for _ in range(n)]
for i in range(1, n):
    g[i].append(a[i])
    g[a[i]].append(i)


f = [0]*n


def dfs(v, par):
    global ans
    for w in g[v]:
        if w != par:
            dfs(w, v)
            if f[w]+1 == k and v != 0:
                ans += 1
                continue
            f[v] = max(f[v], f[w]+1)
    return ans


print(dfs(0, -1))


### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n, k = map(int, input().split())
a = [int(x)-1 for x in input().split()]
ans = 0
if a[0] != 0:
    ans += 1
    a[0] = 0


# g = [[] for _ in range(n)]
# for i in range(1, n):
#     g[i].append(a[i])
#     g[a[i]].append(i)


def dfs(v, par):
    global ans
    for w in g[v]:
        if w != par:
            dfs(w, v)
            if f[w]+1 == k and v != 0:
                ans += 1
                continue
            f[v] = max(f[v], f[w]+1)
    return ans


# TLE
# f = [0]*n
# print(dfs(0, -1))


# Topological Sort (TS)をDFSの代わりとする。
g = [[] for _ in range(n)]
indeg = [0]*n
for i in range(1, n):
    g[a[i]].append(i)
    indeg[i] += 1
q = deque([0])
TS = [0]
while q:
    v = q.popleft()
    for w in g[v]:
        indeg[w] -= 1
        if indeg[w] == 0:
            TS.append(w)
            q.append(w)

f = [0]*n
for w in TS[::-1]:
    if f[w] + 1 == k and a[w] != 0:
        ans += 1
        continue
    f[a[w]] = max(f[a[w]], f[w]+1)

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

N = int(input())
S = input()
R = []
nsum = 0
for i in range(N):
    if S[i] == "R":
        R.append(i)
B = []
for i in range(N):
    if S[i] == "B":
        B.append(i)
g = 0
for i in range(N):
    if S[i] == "G":
        g += 1
        for r in R:
            for b in B:
                if abs(i - b) - abs(b - r) == 0 or abs(b - i) - abs(r - i) == 0 or abs(b - r) - abs(i - r) == 0:
                    nsum += 1
print(len(R)*len(B)*g - nsum)

### FIXED CODE ###

N = int(input())
S = input()
R = 0
G = 0
B = 0
nsum = 0
for s in S:
    if s == "R":
        R += 1
    elif s == "G":
        G += 1
    else:
        B += 1
count = 0
for i in range(N):
    for k in range(i+1,N):
        if not S[i] == S[k]:
            if 2*k - i <= N - 1:
                if S[i] != S[2*k - i] and S[k] != S[2*k - i]:
                    count += 1
print(R*G*B - count)
### BUGGY CODE ###

N, M = map(int, input().split())
drink = []
for _ in range(N):
    drink.append(list(map(int, input().split())))
drink.sort()
ans = 0
while M > 0:
    AB = drink.pop(0)
    b = min(M, AB[1])
    ans += b * AB[0]
    M -= b
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
drink, sumA, sumB = [], 0, 0
for _ in range(N):
    A,B = map(int, input().split())
    drink.append([A, B])
    sumA += A*B
    sumB += B 

if M == sumB:
    print(sumA)
elif M > sumB // 2:
    drink.sort(reverse=True)
    ans, exM = sumA, sumB - M
    while exM > 0:
        AB = drink.pop(0)
        b = min(exM, AB[1])
        ans -= b * AB[0]
        exM -= b
    print(ans)
else:
    drink.sort()
    ans = 0
    while M > 0:
        AB = drink.pop(0)
        b = min(M, AB[1])
        ans += b * AB[0]
        M -= b
    print(ans)
### BUGGY CODE ###

# -*- coding: utf-8 -*-


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n = input_int()
    p = input_to_int_tuple()

    cnt = 0
    for i in range(n):
        temp = True
        for j in range(i):
            if p[i] > p[j]:
                temp = False
                break
        if temp:
            cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-


# 入力を整数に変換して受け取る
def input_int():
    return int(input())


# マイナス1した値を返却
def int1(x):
    return int(x) - 1


# 半角スペース区切り入力をIntに変換してMapで受け取る
def input_to_int_map():
    return map(int, input().split())


# 半角スペース区切り入力をIntに変換して受け取る
def input_to_int_tuple():
    return tuple(map(int, input().split()))


# 半角スペース区切り入力をIntに変換してマイナス1した値を受け取る
def input_to_int_tuple_minus1():
    return tuple(map(int1, input().split()))


def main():
    n = input_int()
    p = input_to_int_tuple()

    cnt = 0
    pre_min = 10 ** 6
    for i in range(n):

        if i == 0 or p[i] <= pre_min:
            cnt += 1

        pre_min = min(pre_min, p[i])

        # temp = True
        # for j in range(i):
        #     if p[i] > p[j]:
        #         temp = False
        #         break
        # if temp:
        #     cnt += 1

    print(cnt)


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

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
P = LIST()

cnt = 1
for i in range(1, N):
	if P[i] == min(P[:i+1]):
		cnt += 1

print(cnt)

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
P = LIST()

cnt = 1
MIN = P[0]

for i in range(1, N):
	MIN = min(MIN, P[i])
	if P[i] == MIN:
		cnt += 1

print(cnt)
### BUGGY CODE ###

A, B, C, D = map(int, input().split())

count = 0
for i in range(A, B+1):
    if i % C != 0 and i % D != 0:
        count += 1

print(count)


### FIXED CODE ###

import math
import fractions

A, B, C, D = map(int, input().split())
lcm = C * D // fractions.gcd(C, D)

count = 0
if A % C == 0:
    div_C = B // C - A // C + 1
else:
    div_C = B // C - A // C

if A % D == 0:
    div_D = B // D - A // D + 1
else:
    div_D = B // D - A // D

if A % lcm == 0:    
    div_C_D = B // lcm - A // lcm + 1
else:
    div_C_D = B // lcm - A // lcm

print(B - A + 1 - div_C - div_D + div_C_D)
### BUGGY CODE ###

def calc(n):
    return n - 1


n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
nList = [k] * n
for i in range(q):
    nList = list(map(calc, nList))
    nList[a[i]-1] += 1

for i in range(n):
    print("Yes" if nList[i] > 0 else "No")


### FIXED CODE ###

n, k, q = map(int, input().split())
nList = [0] * n
for _ in range(q):
    nList[int(input()) - 1] += 1
for j in range(n):
    print("Yes" if k + nList[j] - q > 0 else "No")