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

n = int(input())
A = list(map(int, input().split() ))
q = int(input())
m = list(map(int, input().split()))

def deci_to_bin_list(num, n):
    out = [0]*n
    for i in range(n-1, -1, -1):
        denom = 2**i
        out[i] = num // denom
        num = num % denom
    return out

def sum_selected(A, selected):
    sum = 0
    for a,b in zip(A, selected):
        sum += a*b
    return sum

def sums_to_num(A, num):
    n = len(A)
    for cnt in range(2**n - 1):
        selected = deci_to_bin_list(cnt, n)
        if sum_selected(A, selected) == num:
            return 'yes'
    return 'no'

for num in m:
    print(sums_to_num(A, num))    


### FIXED CODE ###

# used DP

n = int(input())
A = list(map(int, input().split() ))
q = int(input())
M = list(map(int, input().split()))


dp = [[None]*(max(M)+1) for i in range(n)]

# we refer to the list dp only when i = 0, 1, ... , n-1 and m >= 0.
def solve(i, m):    
    if i >= n:
        return m == 0
    
    elif m < 0:
        return False
    
    elif dp[i][m] is not None:
        return dp[i][m]
    
    else:
        if m == 0:
            dp[i][m] = True
        elif solve(i+1, m):
            dp[i][m] = True
        elif solve(i+1, m - A[i]):
            dp[i][m] = True
        else:
            dp[i][m] =  False        
        return dp[i][m]

    
for num in M:
    print('yes' if solve(0, num) else 'no')
### BUGGY CODE ###

r,g,b,n=map(int,input().split())

lst=[r,g,b]
lst.sort()
r=lst[0]
g=lst[1]
b=lst[2]

rlim=n//r
blim=n//b

blist=[]
for i in range(blim+1):
    blist.append(i*b)

cnt=0
for i in range(rlim+1):
    glim=(n-i*r)//g
    for j in range(glim+1):
        if (n-i*r-j*g) in blist:
            cnt+=1
print(cnt)

### FIXED CODE ###

r,g,b,n=map(int,input().split())

lst=[r,g,b]
lst.sort()
r=lst[2]
g=lst[1]
b=lst[0]

rlim=n//r
glim=n//g
blim=n//b

"""
blist = [i*b for i in range(blim+1)]

glist = [i*g for i in range(glim+1)]

def binary_search(list, item):
    low = 0
    high = len(list) - 1

    while low <= high:
        mid = (low + high) //2
        guess = list[mid]
        if guess == item:
            return True
        if guess > item:
            high = mid -1
        else:
            low = mid + 1
    return False
"""

cnt=0

for i in range(rlim+1):
    glim=(n-i*r)//g
    for j in range(glim+1):
        if (n-i*r-j*g)%b==0:
            cnt+=1
print(cnt)
### BUGGY CODE ###

n,m = map(int,input().split())
a = list(map(int,input().split()))
l = [0,2,5,5,4,5,6,3,7,6]

dp = [0]*(n+1)
for i in range(n):
    for j in range(m):
        if dp[i] == 0 and i != 0:
            continue
        x = a[j]
        t = l[x]
        if i+t > n:
            continue
        if dp[i] == 0:
            s0 = x
            s1 = x
        else:
            k = len(str(dp[i]))
            s0 = x*10**(k)+dp[i]
            s1 = 10*dp[i]+x
        dp[i+t] = max(dp[i+t],s0,s1)
print(dp[-1])

### FIXED CODE ###

from math import log10
n,m = map(int,input().split())
a = list(map(int,input().split()))
l = [0,2,5,5,4,5,6,3,7,6]

dp = [0]*(n+1)
for i in range(n):
    for j in range(m):
        if dp[i] == 0 and i != 0:
            continue
        x = a[j]
        t = l[x]
        if i+t > n:
            continue
        if dp[i] == 0:
            s0 = x
            s1 = x
        else:
            k = int(log10(dp[i]))
            s0 = x*10**(k)+dp[i]
            s1 = 10*dp[i]+x
        dp[i+t] = max(dp[i+t],s0,s1)
print(dp[-1])
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
s = 0
for i in A[:N-1]:
    s += 1
    for j in A[s:]:
        ans += i*j
print(ans % (10**9+7))

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
s = sum(A[1:])
for i in range(N-1):
    ans += A[i]*s 
    s = s - A[i+1]
print(ans % (10**9+7))
### BUGGY CODE ###

import numpy as np
n=input()
data=list(map(int,input().split()))
is_i=0
num=sorted(data)
count=num[1]
if 2<len(data):
    while num[0]<count and any([x%count!=0 for x in num[1::]]):
        count=int(count/2)
for i in range(count+1)[::-1]:
    is_i=0
    for j in data:
        if j%i!=0:
            is_i+=1
    if is_i<=1:
        print(i)
        break

### FIXED CODE ###

from fractions import gcd
import numpy as np
n=int(input())
data=list(map(int,input().split()))
left=np.zeros(n+1,dtype=np.int)
right=np.zeros(n+1,dtype=np.int)
kotae=1
for i in range(n):
    left[i+1]=gcd(left[i],data[i])
    right[n-i-1]=gcd(right[n-i],data[n-i-1])
for j in range(n):
    num=gcd(left[j],right[j+1])
    kotae=max(num,kotae)
print(kotae)
### BUGGY CODE ###

from heapq import heappop, heappush
n, m = map(int, input().split())
lst = [list(map(int, input().split())) for i in range(n)]
lst_f = [[] for i in range(m)]
#lst = sorted(lst, key=lambda x:x[0])
#lst = sorted(lst, key=lambda x:x[1], reverse=True)
cnt = 0
ans = 0
cntup = m
for a, b in lst:
  if a <= m:
    lst_f[a-1].append(b)
  #print(filter(lambda y:y<=m-i, map(lambda x:x[0], lst)))
  #lst2 = list(filter(lambda y:y[1]<=m-i, lst))
avb = [] 
for i in lst_f:
  for j in i:
    avb.append(-j)
  if avb != []:
    ans -= min(avb)
    avb.remove(min(avb))
print(ans)


### FIXED CODE ###

from heapq import heappop, heappush
n, m = map(int, input().split())
lst = [list(map(int, input().split())) for i in range(n)]
lst_f = [[] for i in range(m)]
#lst = sorted(lst, key=lambda x:x[0])
#lst = sorted(lst, key=lambda x:x[1], reverse=True)
cnt = 0
ans = 0
cntup = m
for a, b in lst:
  if a <= m:
    lst_f[a-1].append(b)
  #print(filter(lambda y:y<=m-i, map(lambda x:x[0], lst)))
  #lst2 = list(filter(lambda y:y[1]<=m-i, lst))
avb = [] 
for i in lst_f:
  for j in i:
    heappush(avb, -j)
  if avb != []:
    ans -= heappop(avb)
print(ans)
### BUGGY CODE ###

import bisect
n,m = [int(i) for i in input().split()]
l = sorted([int(i) for i in input().split()])
for i in range(m):
    bisect.insort(l,l[n-1]//2)
    
print(sum(l[0:n]))

### FIXED CODE ###

import heapq
n,m = [int(i) for i in input().split()]
l = [int(i) for i in input().split()]
h = []
for i in l:
    i = -1*i
    heapq.heappush(h,i)
    
for _ in range(m):
    v = -heapq.heappop(h)
    heapq.heappush(h,-1*(v//2))
    
print(-sum(h))
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    N, M = map(int, input().split())
    L = [0] * M
    R = [0] * M
    for i in range(M):
        L[i], R[i] = map(int, input().split())

    c = [0] * (N + 1)

    for i in range(M):
        for j in range(1, L[i]):
            c[j] += 1
        for j in range(R[i] + 1, N + 1):
            c[j] += 1

    print(c.count(0) - 1)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    N, M = map(int, input().split())
    L = [0] * M
    R = [0] * M
    for i in range(M):
        L[i], R[i] = map(int, input().split())

    ans = min(R) - max(L) + 1
    print(max(0, ans))

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

import sys
import copy
import time
import random

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline

D = None
C = None
S = None

def cnt_score(t):
    global D, C, S
    score = 0
    cnt = [-1] * 26

    for i in range(D):
        score += S[i][t[i] - 1]
        minusscore = 0
        cnt[t[i] - 1] = i
        for j in range(26):
            minusscore += (i - cnt[j]) * C[j]
        score -= minusscore
    return score

# def cnt_contest_score(t, cid):
#     global D, C, S
#     score = 0
#
#     for i in range(D):
#         score -= minusscore
#     return score


def main():
    global D, C, S
    D = int(input())
    C = [int(x) for x in input().split()]
    S = [[int(x) for x in input().split()] for _ in range(D)]

    start = time.time()

    ans = []
    for s in S:
        ans.append(s.index(max(s)) + 1)

    # A = [[None] * COL for j in range(ROW)]

    old_score = cnt_score(ans)
    day = 0
    f = False
    while True:
        new_ans = copy.deepcopy(ans)

        max_sore = old_score
        max_contest = ans[day]
        for i in range(26):
            # time up
            current = time.time()
            if current - start > 1.95:
                f = True
                break

            # main
            new_ans[day] = i + 1
            new_score = cnt_score(new_ans)
            if new_score > old_score:
                max_contest = i + 1
                old_score = new_score
        ans[day] = max_contest
        if f:
            break


        # increment day
        day = (day + 1) % D

    for a in ans:
        print(a)



if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    D = int(input())
    C = [int(x) for x in input().split()]
    S = [[int(x) for x in input().split()] for _ in range(D)]


    for i in range(D):
        print(i % 26 + 1)



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

n = int(input())
s = str(input())
d = s.split()
mod = 10 ** 18
ans = int(d[0])
d.pop(0)
if '0' in d:
	print(0)
else:
	for i in d:
		i = int(i)
		ans = ans * i 
	if ans > mod:
		print(-1)
	else:
		print(ans)


### FIXED CODE ###

n = int(input())
s = str(input())
d = s.split()
mod = 10 ** 18
ans = int(d[0])
d.pop(0)
z = 0
if '0' in d:
	print(0)
else:
	for i in d:
		i = int(i)
		ans *= i
		if ans > mod:
			print(-1)
			z = 1
			break
	if z == 1:
		pass
	else:
		print(ans)
### BUGGY CODE ###

N=int(input())
A=list(map(int,input().split()))
tmp=0
for i in range(N):
  L=A[i+1:N]
  ##print(L)
  ##print(sum(L))
  ##print(A[i])
  tmp=(A[i]*sum(L)+tmp)%(10**9+7)
print(tmp)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
S=sum(A)
##print(S)
tmp=0
T=0
for i in range(N-1):
  T=T+A[i]
  ##print(T)
  ##print(A[i])
  tmp=(A[i]*(S-T)+tmp)
tmp=tmp%(10**9+7)
print(tmp)
### BUGGY CODE ###

from numba import jit
from sys import stdin
h, n = map(int, input().split())
magic = [list(map(int, stdin.readline().split())) for _ in range(n)]
INF = float('inf')
ans = [INF]*(h+1)
ans[-1] = 0

def num(ans):
    for i in range(h, 0, -1):
        if ans[i] == float('inf'):
            continue
        else:
            for j in magic:
                if i-j[0] < 0:
                    if ans[0] > ans[i]+j[1]:
                        ans[0] = ans[i]+j[1]
                elif ans[i-j[0]] > ans[i]+j[1]:
                    ans[i-j[0]] = ans[i]+j[1]
    return ans[0]
print(num(ans))




### FIXED CODE ###

def num():
    from sys import stdin
    h, n = map(int, input().split())
    magic = [list(map(int, stdin.readline().split())) for _ in range(n)]
    INF = float('inf')
    ans = [INF]*(h+1)
    ans[-1] = 0

    for i in range(h, 0, -1):
        if ans[i] != INF:
            for j, k in magic:
                if i-j < 0:
                    num = ans[i]+k
                    if ans[0] > num:
                        ans[0] = num
                else:
                    num = ans[i]+k
                    if ans[i-j] > num:
                        ans[i-j] = num
    return ans[0]
print(num())
### BUGGY CODE ###

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

for j in range(k):
    s = [0] * (n + 1)
    for i in range(n):
        if i - a[i] >= 0:
            s[i - a[i]] += 1
        else:
            s[0] += 1
        if i + a[i] + 1 < n + 1:
            s[i + a[i] + 1] -= 1
        else:
            s[n] -= 1
            
    s_ = [0] * (n + 1)
    s_[0] = s[0]
    for i in range(n):
        s_[i + 1] = s_[i] + s[i + 1]
        
    a = s_
    
print(*s_[:n])


### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
if k >= 50:
    k = 50
for j in range(k):
    s = [0] * (n + 1)
    for i in range(n):
        if i - a[i] >= 0:
            s[i - a[i]] += 1
        else:
            s[0] += 1
        if i + a[i] + 1 < n + 1:
            s[i + a[i] + 1] -= 1
        else:
            s[n] -= 1
            
    s_ = [0] * (n + 1)
    s_[0] = s[0]
    for i in range(n):
        s_[i + 1] = s_[i] + s[i + 1]
        
    a = s_
    
print(*s_[:n])
### BUGGY CODE ###

class Node:
    def __init__(self,v):
        self.v = v
        self.left = None
        self.right = None

def inorder(n):
    if n != None:
        inorder(n.left)
        print n.v,
        inorder(n.right)

def preorder(n):
    if n != None:
        print n.v,
        preorder(n.left)
        preorder(n.right)

class BST:
    def __init__(self):
        self.root = None

    def find(self,v):
        x = self.root
        while x != None:
            if x.v == v:
                return True
            elif x.v < v:
                x = x.right
            else:
                x = x.left
        return False

    def insert(self,v):
        n = Node(v)
        x = self.root
        y = None
        while x != None:
            y = x
            if x.v > v:
                x = x.left
            else:
                x = x.right
        if y == None:
            self.root = n
        else:
            if y.v > v:
                y.left = n
            else:
                y.right = n
    def print_tree(self):
        print '',
        inorder(self.root)
        print
        print '',
        preorder(self.root)
        print


n = int(raw_input())
ops = []
for _ in range(n):
    ops.append(raw_input())

tree = BST()
for op in ops:
    if op[0] == 'i':
        num = op.split(' ')[1]
        num = int(num)
        tree.insert(num)
    elif op[0] == 'f':
        num = op.split(' ')[1]
        num = int(num)
        if tree.find(num):
            print 'yes'
        else:
            print 'no'
    else:
        tree.print_tree()

### FIXED CODE ###

def insert(tree,k):
    y = None
    x = tree
    z = {'key':k, 'parent':None, 'left':None, 'right':None}
    while x != None:
        y = x
        if x['key'] > k:
            x = x['left']
        else:
            x = x['right']
    z['parent'] = y
    if y == None:
        tree = z
    elif y['key'] > k:
        y['left'] = z
    else:
        y['right'] = z
    return tree

def find(tree,k):
    x = tree
    while x != None:
        if x['key'] == k:
            print "yes"
            return
        elif x['key'] > k:
            x = x['left']
        else:
            x = x['right']
    print "no"

def middleorder(x):
    if x != None:
        middleorder(x['left'])
        print x['key'],
        middleorder(x['right'])

def preorder(x):
    if x != None:
        print x['key'],
        preorder(x['left'])
        preorder(x['right'])



tree = None
m = int(raw_input())
for i in range(m):
    c = raw_input().strip()
    if c[0] == 'i':
        tree = insert(tree, int(c[7:]))
    elif c[0] == 'f':
        find(tree, int(c[5:]))
    elif c[0] == 'p':
        print '',
        middleorder(tree)
        print
        print '',
        preorder(tree)
        print
### BUGGY CODE ###

N = int(input())
direction = list(input())
change = [0]*N
 
for i in range(N):
    left = direction[0:i]
    right = direction[i+1:N]
    change[i] += left.count("W")
    change[i] += right.count("E")
    # print(left,right)
print(min(change))

### FIXED CODE ###

N = int(input())
direction = list(input())
change = [0]*(N+1)
# print(direction)
change[0] = direction.count("E")
# print(change)
for i in range(N):
    f_n = 0
    f_p = 0
    if direction[i] == "E":
        f_n = 1
    else:
        f_p = 1
    change[i+1] = change[i] - f_n + f_p
# print(change)
print(min(change))
### BUGGY CODE ###

n=int(input())
l=list(map(int,input().split()))
for i in range(1,n):
    print(l.count(i))
    for _ in range(l.count(i)):
        l.remove(i)
print(0)


### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
m=[0]*n
for i in l:
    m[i-1]+=1
for j in range(n):
    print(m[j])
### BUGGY CODE ###


# -*- coding: utf-8 -*-
S = input()
Q = int(input())

rev = False

for q in range(Q):
    i = input().split()
    if i[0] == "1":
        rev = not rev
    elif not rev and i[1] == "1" or rev and i[1] == "2":
        S = i[2] + S
    else:
        S = S + i[2]

if rev:
    S = S[::-1]
print(S)


### FIXED CODE ###


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

S = input()
Q = int(input())

rev = False
S1 = ['0'] * Q
S1i = 0
S2 = ['0'] * Q
S2i = 0

for q in range(Q):
    i = input()
    if i[0] == "1":
        rev = not rev
    elif not rev and i[2] == "1" or rev and i[2] == "2":
        # S = i[4] + S
        S1[S1i] = i[4]
        S1i += 1
    else:
        # S = S + i[4]
        S2[S2i] = i[4]
        S2i += 1

S1 = S1[0:S1i]
S2 = S2[0:S2i]
S1 = S1[::-1]

S = ''.join(''.join(S1) + S + ''.join(S2))

if rev:
    S = S[::-1]

print(S)
### BUGGY CODE ###

import collections

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
c = collections.Counter(a)
data = sorted(list(set(a)))
prime_bool = [True]*(max(a)+1)
prime_bool[0] = False

for i in range(len(data)):
  p = data[i]
  if prime_bool[p]:
    #print(p)
    k = 2
    while k*p <= max(a):
      prime_bool[k*p] = False
      k += 1

count = 0
for i in range(len(prime_bool)):
  if prime_bool[i]:
    if c[i] == 1:
      count += 1
print(count)
#print(prime_bool)


### FIXED CODE ###

import collections

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
c = collections.Counter(a)
data = sorted(list(set(a)))
max_ = max(a)+1
prime_bool = [True]*max_
prime_bool[0] = False

for i in range(len(data)):
  p = data[i]
  if prime_bool[p]:
    #print(p)
    k = 2
    while k*p < max_:
      prime_bool[k*p] = False
      k += 1

count = 0
for i in range(len(prime_bool)):
  if prime_bool[i]:
    if c[i] == 1:
      count += 1
print(count)
#print(prime_bool)
### BUGGY CODE ###

s=input()
k=int(input())
a=[]
for i in range(0,len(s)):
    for j in range(1,len(s)+1):
        a.append(s[i:j])
num = a.count("")
for i in range(num):
    a.remove("")
a=sorted(a)
b=[]
for i in a:
    if i not in b:
        b.append(i)
print(b[k-1])


### FIXED CODE ###

s=input()
k=int(input())
a=[s[i:i+j+1] for i in range(len(s)) for j in range(k+1)]
a=set(a)
a=sorted(a)
print(a[k-1])
### BUGGY CODE ###

# ABC102 C-Linear Approximation

import numpy as np

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

As = [0]*N
for i, j in enumerate(A):
    As[i] = j - (i+1)

As = np.array(As)
temp = np.median(As)
# temp = sum(As) // len(As)
ans1, ans2, ans3 = 0, 0, 0
for i in As:
    ans1 += abs(i - temp)
    ans2 += abs(i - (temp+1))
    ans3 += abs(i - (temp-1))
    
print(int(min(ans1, ans2, ans3)))

### FIXED CODE ###

# ABC102 C-Linear Approximation

N = int(input())
A = list(int(s) for s in input().split())
ami = [A[i] - i - 1 for i in range(N)]
ami.sort()
b = ami[N // 2]
print(sum(abs(v - b) for v in ami))
### BUGGY CODE ###

r,g,b,n=map(int,input().split())
ans=0
for i in range(n//r+1):
    for j in range(n//g+1):
        if (n-(r*i+g*j))%b==0:
            if (n-(r*i+g*j))//b>=0:
                ans+=1
print(ans)

### FIXED CODE ###

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

from collections import deque
n = int(input())
edges = [[] for _ in range(n)]

for i in range(n):
    s = input()
    for j in range(n):
        if s[j] == '1':
            edges[i].append(j)

#可能か
flg = True
l, r = set(), set()
l.add(0)
que = deque()
que.append((0, True))
is_left = True
while que and flg:
    cur, is_left = que.popleft()
    for to in edges[cur]:
        if is_left:
            if to in l:
                flg = False
            elif to not in r:
                r.add(to)
                que.append((to, False))
        else:
            if to in r:
                flg = False
            elif to not in l:
                l.add(to)
                que.append((to, True))

    if is_left:
        is_left = False
    else:
        is_left = True


if not flg:
    print(-1)

else:
    def warshall_floyd(d, v):
        for k in range(v):
            for i in range(v):
                for j in range(v):
                    d[i][j] = min(d[i][j], d[i][k] + d[k][j])

    inf = 1000
    d = [[inf] * n for _ in range(n)]
    for i in range(n):
        for j in range(n):
            if j in edges[i]:
                d[i][j] = 1

    warshall_floyd(d, n)
    
    ans = 0
    for i in range(n):
        for j in range(n):
            if i == j:
                continue
            ans = max(ans, d[i][j]+1)

    print(ans)


### FIXED CODE ###

from collections import deque
n = int(input())
edges = [[] for _ in range(n)]

for i in range(n):
    s = input()
    for j in range(n):
        if s[j] == '1':
            edges[i].append(j)

#可能か
flg = True
l, r = set(), set()
l.add(0)
que = deque()
que.append((0, True))
is_left = True
while que and flg:
    cur, is_left = que.popleft()
    for to in edges[cur]:
        if is_left:
            if to in l:
                flg = False
            elif to not in r:
                r.add(to)
                que.append((to, False))
        else:
            if to in r:
                flg = False
            elif to not in l:
                l.add(to)
                que.append((to, True))

    if is_left:
        is_left = False
    else:
        is_left = True


if not flg:
    print(-1)

else:
    def warshall_floyd(d, v):
        for k in range(v):
            for i in range(v):
                for j in range(v):
                    d[i][j] = min(d[i][j], d[i][k] + d[k][j])

    inf = 1000
    d = [[inf] * n for _ in range(n)]
    for i in range(n):
        for j in range(n):
            if j in edges[i]:
                d[i][j] = 1

    warshall_floyd(d, n)
    
    ans = 0
    for i in range(n):
        for j in range(n):
            if i == j:
                continue
            ans = max(ans, d[i][j]+1)

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

N, K=map(int, input().split())
A=list(map(int, input().split()))
for i in range(K,N):
    a=1
    b=1
    for j in range(K):
        a*=A[i-K+j]
        b*=A[i-K+j+1]
    if a<b: 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 ###

N,K,Q=map(int,input().split())
A=[K]*N

for q in range(Q):
  win=int(input())
  for i,j in enumerate(A):
    if i!=win-1:
      A[i]-=1

def hantei(x):
    if x >0:
        return('Yes')
    else:
        return('No')
      
for answer in map(hantei,A):
    print(answer)

### FIXED CODE ###

N,K,Q=map(int,input().split())
A=[0]*N
for i in range(Q):
    A[int(input())-1]+=1
for j in range(N):
    if K-Q+A[j]>0:
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

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

min_score = float('inf')
for i in range(1, N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            l = [sum(A[:i]), sum(A[i:j]), sum(A[j:k]), sum(A[k:])]
            score = max(l) - min(l)
            if score < min_score:
                min_score = score

print(min_score)

### FIXED CODE ###

from statistics import mean

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

S = [A[0]]
for i in range(1, N):
    S.append(S[i - 1] + A[i])   

left_middle = 0
right_middle = 2

ans = float('inf')

for middle in range(1, N - 2):
    left_sum = S[left_middle]
    right_sum = S[middle] - left_sum
    diff = abs(left_sum - right_sum)

    for i in range(left_middle+1, middle):
        left_sum = S[i]
        right_sum = S[middle] - left_sum
        if diff > abs(left_sum - right_sum):
            left_middle = i
            diff = abs(left_sum - right_sum)
        else:
            break
    
    left_sum = S[right_middle] - S[middle]
    right_sum = S[-1] - S[right_middle]
    diff = abs(left_sum - right_sum)

    for i in range(right_middle + 1, N):
        left_sum = S[i] - S[middle]
        right_sum = S[-1] - S[i]
        if diff > abs(left_sum - right_sum):
            right_middle = i
            diff = abs(left_sum - right_sum)
        else:
            break
    
    s1 = S[left_middle]
    s2 = S[middle] - s1
    s3 = S[right_middle] - s1 - s2
    s4 = S[-1] - s1 - s2 - s3

    score = max(s1, s2, s3, s4) - min(s1, s2, s3, s4)
    ans = min(ans, score)

print(ans)