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

import numpy as np
n = int(input())
s = np.array([True if i=='E' else False for i in input()])
w = 0
e = np.sum(s[1:])
ans = w+e
for i in range(1,n):
  w = w + (not s[i-1])
  e = e - s[i]
  ans = min(ans,w+e)
print(ans)

### FIXED CODE ###

import numpy as np
n = int(input())
s = np.array([True if i=='E' else False for i in input()])
t = np.array([False if i else True for i in s])
t = np.cumsum(t)
t = np.hstack(([0], t[1:]))
s = np.cumsum(s[::-1])[::-1]
s = np.hstack((s[1:], [0]))
print(np.min(s+t))
### BUGGY CODE ###

#ないよりも10倍以上早くなる
import sys
input = sys.stdin.readline
 
K,S=map(int,input().split())
if 2<=K<=2500 and 0<=S<=3*K:
    count=0
    Ks=[]
    wa=[]
    for i in range(K+1):
        Ks.append(i)
    X,Y,Z =Ks,Ks,Ks
    for x in X:
      if x<=S:
        X_=[]
        X_.append(x)
        for y in Y:
          if y<=S:
            X_Y_=list(X_)
            X_Y_.append(y)
            wa_=sum(X_Y_)
            wa.append(wa_)
    wa= [w for w in wa if w<=S]
    for z in Z:
      if z<=S:
        for j in wa:
            j+=z
            if j==S:
                count+=1
    print(count)

### FIXED CODE ###

import sys
input = sys.stdin.readline
 
K,S=map(int,input().split())
count=0
for x in range(K+1):
    for y in range(K+1):
        if S-(x+y)>=0 and S-(x+y)<=K: count+=1
print(count)
### BUGGY CODE ###

n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]

li2 = sorted([sum(li[m:m+k]) for m in range(0, len(li) - k + 1, 1)], reverse=True)

print(li2[0])

### FIXED CODE ###

n, k = map(int, input().split())
li = [(int(j) + 1) / 2 for j in input().split()]

if k == 1:
  print(max(li))
else:
  a = 0
  for i in range(n-k+1):
    if i == 0:
      xe = sum(li[0:k])
    else:
      xe = xe - li[i-1] + li[i+k-1]
    a = max(a, xe)
  print(a)
### BUGGY CODE ###

N = int(input())
p = list(map(float,input().split()))

dp = [[0]*(N+1) for i in range(N+1)] #dp[投げた枚数][表になった回数] = 確率
dp[0][0] = 1.0

for i in range(N):
  for j in range(i+1):
    dp[i+1][j+1] += dp[i][j]*p[i]
    dp[i+1][j] += dp[i][j]*(1-p[i])

ans = 0
for j in range(N+1):
  if j >= N/2:
    ans += dp[-1][j]
print(ans)

### FIXED CODE ###

N = int(input())
p = list(map(float,input().split()))

dp = [[0]*(N+1) for i in range(N+1)] #dp[投げた枚数][表になった回数] = 確率
dp[0][0] = 1.0

for i in range(N):
  for j in range(i+1):
    dp[i+1][j+1] += dp[i][j]*p[i]
    dp[i+1][j] += dp[i][j]*(1-p[i])

ans = 0
for j in range(N+1):
  if j >= N/2:
    ans += dp[-1][j]
print(ans)
### BUGGY CODE ###


from copy import deepcopy
# 多次元配列を作成する
def make_multi_list(initial, degree):
    ans = [initial for _ in range(degree[-1])]
    for d in reversed(degree[:-1]):
        ans = [deepcopy(ans) for _ in range(d)]
    return ans


N, T = map(int, input().split())
AB = []
for i in range(N):
    a, b = map(int, input().split())
    AB.append((a, b))
AB.sort()

ans = 0
dp = make_multi_list(0, [3000, 3000])
for i in range(N):
    a, b = AB[i]
    for j in range(T):
        # iを使わないパターン
        dp[i+1][j] = max(dp[i+1][j], dp[i][j])
        # iを使うパターン
        nj = j+a
        if nj < T:
            dp[i+1][nj] = max(dp[i + 1][nj], dp[i][j]+b)
    now = dp[i][T-1]+AB[i][1]
    ans = max(ans, now)

print(ans)

### FIXED CODE ###

from copy import deepcopy

# 多次元配列を作成する
def make_multi_list(initial, degree):
    ans = [initial for _ in range(degree[-1])]
    for d in reversed(degree[:-1]):
        ans = [deepcopy(ans) for _ in range(d)]
    return ans


N, T = map(int, input().split())
AB = []
for i in range(N):
    a, b = map(int, input().split())
    AB.append((a, b))
AB.sort()

ans = 0
dp = make_multi_list(0, [3005, 3005])
for i in range(N):
    a, b = AB[i]
    for j in range(T):
        # iを使わないパターン
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
        # iを使うパターン
        nj = j + a
        if nj < T:
            dp[i + 1][nj] = max(dp[i + 1][nj], dp[i][j] + b)
    now = dp[i][T - 1] + b
    ans = max(ans, now)

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

def count(num):
    ans = 1
    x = 2
    while x * x <= num:
        cnt = 1
        while num % x == 0:
            cnt += 1
            num /= x
        ans *= cnt
        x += 1
    return ans * (1 + (num > 1))

n = int(input())
res = 0
for i in range(1, n+1):
    res += i * count(i)

print(res)

### FIXED CODE ###

n = int(input())
res = 0
for i in range(1, n+1):
    x = n//i
    res += i*x*(x+1)/2

print(int(res))
### BUGGY CODE ###

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

Cn, ans = N * (N-1) // 2, 0

for i in range(60):
    count = 0
    for j in range(N):
        count += A[j] % 2
        A[j] //= 2
    if count == 0:
        continue
    ans += (Cn - (count*(count-1)//2 + (N-count)*(N-count-1)//2)) * (2**i)
print(ans % (10**9 + 7)) 

### FIXED CODE ###

import numpy as np

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

Cn, ans = N * (N-1) // 2, 0

for i in range(60):
    count = int(np.sum(A % 2))
    A //= 2
    if count == 0:
        continue
    ans += (Cn - (count*(count-1)//2 + (N-count)*(N-count-1)//2)) * (2**i)
print(ans % (10**9 + 7))
### BUGGY CODE ###

import sys
import math
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

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

II = input_int

def map_int_input():
    return map(int, input())

MII = map_int_input

def MII_split():
    return map(int, input().split())

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

def LII_split():
    return list(map(int, input().split()))

# 2次元リスト化
def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

S = input()
N = len(S)
# N 文字の文字列 S から、長さ N+1 の累積和 s[0], s[1], ..., s[N] を作る
# これを 2019 で割ったあまりで分類する (具体的には counter[ r ] := あまりが r のやつが何個あるか)
# 各 r ごとに、counter[r] 個から 2 個選ぶ方法の数を、足し上げる

counter = dict()

for i in range(N + 1):
    sub = int(S[N - i:]) if S[N - i:] else 0
    rest = sub % 2019
    if rest in counter:
        counter[rest] += 1
    else:
        counter[rest] = 1

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

ans = 0
for r in counter.values():
    if r >= 2:
        ans += combinations_count(r, 2)
print(ans)

### FIXED CODE ###

S = list(input())
N = len(S)
# N 文字の文字列 S から、長さ N+1 の ---累積和--- s[0], s[1], ..., s[N] を作る
# これを 2019 で割ったあまりで分類する (具体的には counter[ r ] := あまりが r のやつが何個あるか)
# 各 r ごとに、counter[r] 個から 2 個選ぶ方法の数を、足し上げる

counter = [0] * 2019
k = 10
for i in range(N + 1):
    if i == 0:
        sub = 0
    elif i == 1:
        sub = int(S[N - 1])
    else:
        sub += int(S[N - i]) * k
        k *= 10
        k %= 2019
    rest = sub % 2019
    counter[rest] += 1

ans = 0
for r in counter:
    ans += r * (r - 1) // 2
print(ans)
### BUGGY CODE ###

K=int(input())
if K%2==0:
    print('-1')
    exit()
A='7'*(10**6)
a=int(A)
i=10**6
l=[]
while True:
    a//=10
    if a%K==0:
        break
    elif a in l:
        print('-1')
        break
    l.append(a)
    i-=1
arr=[]
x=i
for j in range(2,int(i**0.5)+1):
    if x%j==0:
        arr.append(i)
        while x%j==0:
            x//=j
if x!=1:
    arr.append(x)
for k in arr:
    if int('7'*k)%K!=0:
        arr.remove(k)
if arr==[]:
    print(i)
else:
    print(min(arr))





### FIXED CODE ###

K=int(input())
if K%2==0 or K%5==0:
    print('-1')
    exit()
a=0
i=1
while True:
    a=(a*10+7)%K
    if a==0:
        print(i)
        break
    i+=1
### BUGGY CODE ###

import math
import itertools

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

all_combination = 0
less_than_K_combination = 0
for num in range(K, N + 2): # 選ぶ個数を1 から N + 1個までずらす
    targetList = []
    for each_num in range(num):
        targetList.append(each_num)
    min = sum(targetList)
    targetList = []
    for each_num in range(N + 1 - num, N + 1):
        targetList.append(each_num)
    max = sum(targetList)
    all_combination += max - min + 1

#for num in range(1, K): # 選ぶ個数を1 から K - 1個までずらす
#    targetList = []
#    for each_num in range(num):
#        targetList.append(each_num)
#    min = sum(targetList)
#    targetList = []
#    for each_num in range(N + 1 - num, N + 1):
#        targetList.append(each_num)
#    max = sum(targetList)
#    less_than_K_combination += max - min + 1

print(all_combination)

### FIXED CODE ###

import math
import itertools

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

all_combination = 0
for num in range(K, N + 2): # 選ぶ個数を1 から N + 1個までずらす
    min = (0 + num - 1) * num / 2
    max = (N - (num - 1) + N) * num / 2
    possiblility = (int(max) - int(min) + 1)
    all_combination += possiblility

print(all_combination % (1000000007))
### BUGGY CODE ###

import itertools
import bisect

def main():
    N = int(input())
    letterset = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
    check = []
    for i in range(1, N+1):
        iters = itertools.product(letterset[:i], repeat=N)
        for tmp in iters:
            if len(set(tmp)) == i:
                flag = True
                if tmp[0] != 'a':
                    flag = False
                for k in range(N-1):
                    if not tmp[k+1] in letterset[:len(set(tmp[:k+1]))+1]:
                        flag = False
                if flag:
                    check.append(''.join(tmp))
    check.sort()
    for ans in check:
        print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys

sys.setrecursionlimit(10**7)
strlist = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

def dfs(n, before):
    lensetbefore = len(set(before))
    if n == 1:
        print(before)
    if n > 1:
        for s in strlist[:lensetbefore+1]:
            dfs(n-1, before+s)

def main():
    N = int(input())
    dfs(N, 'a')


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

n=int(input())
a=list(map(int,input().split()))
for i in range(n):
    print(a.count(i+1))


### FIXED CODE ###

from collections import Counter
n=int(input())
a=list(map(int,input().split()))
s=Counter(a)
for i in range(n):
    print(s[i+1])
### BUGGY CODE ###

def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A

def digits2int(c, L, MOD):
    base = 0
    for i in range(L):
        f = (c[i] << i) % MOD
        base = (base + f) % MOD
    return base


def solve(N, A, L=60, MOD=10**9+7):
    # j桁目のビットが1であるものの数を、累積和として記憶
    count_ones = [[0 for j in range(L+1)] for i in range(N+1)]
    for i in range(N):
        for j in range(L):
            count_ones[i+1][j] = count_ones[i][j] + ((A[i] >> j) & 1)
    # A[i] と A[j] (i<j) のxorをとる
    modsum = 0
    for i in range(N-1):
        c = [0 for j in range(L)]
        for j in range(L):
            if ((A[i] >> j) & 1) == 0:
                c[j] = count_ones[N][j] - count_ones[i+1][j]
            else:
                c[j] = (N-i-1) - (count_ones[N][j] - count_ones[i+1][j])
        modsum = (modsum + digits2int(c, L, MOD)) % MOD
    return modsum


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))

### FIXED CODE ###

def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A


def solve(N, A, L=60, MOD=10**9+7):
    modsum = 0
    for j in range(L):
        count_ones = sum([1 for a in A if (a >> j) & 1])
        # count_ones = sum([(A[i] >> j) & 1 for i in range(N)])
        count_zeros = N - count_ones
        # MODは一度にとる
        modsum +=  (1<<j) * count_zeros * count_ones
        modsum %= MOD
    return modsum


if __name__ == '__main__':
    inputs = read()
    print("%d" % solve(*inputs))
### BUGGY CODE ###

n=int(input())
lists=[]
for i in range(n):
    s=input()
    lists.append(s)
is_good=[[False for i in range(n)] for j in range(n)]
for i in range(n):
    for j in range(n):
        p=lists[i][j:]+lists[i][:j]
        flag=True
        for k in range(n):
            if p[k]!=lists[(i+k)%n][j]:
                flag=False
                break
        if flag:
            is_good[i][j]=True

counter=0
for i in range(n):
    for j in range(n):
        flag=True
        for k in range(n):
                if is_good[(i+k)%n][(j+k)%n]==False:
                    flag=False
                    break
        if flag:
            
            counter+=1
print(counter)
            

### FIXED CODE ###

n=int(input())
lists=[]
for i in range(n):
    s=input()
    lists.append(s)
is_good=[[False for i in range(n)] for j in range(n)]
for i in range(n):
    for j in range(n):
        p=lists[i][j:]+lists[i][:j]
        flag=True
        for k in range(n):
            if p[k]!=lists[(i+k)%n][j]:
                flag=False
                break
        if flag:
            is_good[i][j]=True

counter=0
for i in range(n):
    for j in range(n):
        flag=True
        for k in range(n):
                if is_good[(i+k)%n][(j+k)%n]==False:
                    flag=False
                    break
        if flag:
            
            counter+=1
print(counter)
### BUGGY CODE ###

from collections import deque

N,M=map(int,input().split())
Out=[set() for i in range(N+1)]  # 頂点の番号は0-initialのまま扱う
for i in range(M):
    u,v=map(int,input().split())
    Out[u].add(v)
S,T=map(int,input().split())

Out2=[set() for i in range(N+1)]
for i in range(1,N+1):
    for j in Out[i]:
        Out2[i].update(Out[j])

Out3=[set() for i in range(N+1)]
for i in range(1,N+1):
    for j in Out[i]:
        Out3[i].update(Out2[j])

#print(Out)
#print(Out2)
#print(Out3)

dis=[-1 for i in range(N+1)];dis[S]=0 # 頂点Sからの距離
# WFS
q=deque() # 遅ければlistで実装
q.append(S)
while q:
#    print(q) #DB
#    print(dis) #DB
    u=q.popleft()
    vs=[v for v in Out3[u] if dis[v]==-1]
    for v in vs:
        dis[v]=dis[u]+1
    q.extend(vs)

print(dis[T])


### FIXED CODE ###

from collections import deque

N,M=map(int,input().split())
a=[[[] for j in range(N)] for i in range(3)] # 0-indexのグラフが3つある
for i in range(M):
    u,v=map(lambda x:int(x)-1,input().split())
    a[0][u].append((1,v))
    a[1][u].append((2,v))
    a[2][u].append((0,v))
S,T=map(lambda x:int(x)-1,input().split())
# print(a)

r=[[-3 for j in range(N)] for i in range(3)]
q=deque()
q.append((0,S));r[0][S]=0
while q:
    ui,uj=q.popleft()
    for vi,vj in a[ui][uj]:
        if r[vi][vj]==-3:
            r[vi][vj]=r[ui][uj]+1
            q.append((vi,vj))
# print(r)
print(r[0][T]//3)
### BUGGY CODE ###

import numpy as np
n,m = list(map(int,input().split()))
d = [[1<<n] for _ in range(m)]
s = 1<<0
for i in range(m):
  a,b = list(map(int,input().split()))
  d[i] = ((1<<a)-1) ^ ((1<<b)-1)
  s |= d[i]

spr = [[False] for _ in range(m)]

ans = float('inf')
for bit in range(1<<n):
  spr = [True for _ in range(m)]
  for i in range(n):
    if bit & 1<<i and s & 1<<i:
      for k in range(m):
        if (d[k] & 1<<i) > 0:
          spr[k] = False
      if sum(spr) == 0:
        ans = min(ans, sum([1 for i in range(n) if bit & 1<<i]))

print(ans)
     


### FIXED CODE ###


n,m = list(map(int,input().split()))
d = [0]*m
spr = [True]*m
ma = 0
mi = 0
for i in range(m):
    a,b = list(map(int,input().split()))
    d[i] = [a,b]

d = sorted(d)
pre = d[0][1]
ans = 1
for i,(a,b) in enumerate(d):
  if a < pre:
    if b < pre:
      pre = b
  else:
    ans += 1
    pre = b

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

N = int(input())
A_list = list(map(int, input().split()))
#myans_list =  [ [0 for n in range(N)] for nn in range(N) ]
#myans = 0
#for n in range(N):
#    for nn in range(N):
#        myans_list[n][nn] = A_list[n] * A_list[nn]
#for n in myans_list:
#    print(n)
myans = 0
for n in range(N-1):
    for nn in range(n+1, N):
        myans += A_list[n] * A_list[nn]
print(myans%(1000000007))

### FIXED CODE ###

N = int(input())
A_list = list(map(int, input().split()))
#myans_list =  [ [0 for n in range(N)] for nn in range(N) ]
#myans = 0
#for n in range(N):
#    for nn in range(N):
#        myans_list[n][nn] = A_list[n] * A_list[nn]
#for n in myans_list:
#    print(n)
mysum = sum(A_list)
myans = 0
for n in range(N-1):
    mysum -= A_list[n]
    myans +=  mysum*A_list[n]
print(myans%(1000000007))
### BUGGY CODE ###

from collections import Counter

N = int(raw_input())
O = list(map(int, raw_input().split()))

cnt = Counter(O)
cnt = dict(cnt)

for i in O:
    cnt[i] = cnt.get(i, 1) - 1
    res = 0

    for k in cnt:
        if cnt[k] >=2:
            res += (cnt[k]*(cnt[k]-1))/2
    print(res)

    cnt[i] += 1

### FIXED CODE ###

N = int(raw_input())
A = map(int, raw_input().split())
 
count = [0]*(N+2)
for i in range(N):
    id = A[i]
    count[id] = count[id]+1
 
sumN = long(0)
for i in range(N+1):
    sumN = sumN + long(long(count[i]*(count[i]-1))/2)
 
for i in range(N):
    id = A[i]
    sumz = sumN - (count[id] - 1)
    print(sumz)
### BUGGY CODE ###

import numpy as np

N, K = map(int, input().split())
A_list = np.array(list(map(int, input().split())))
Base = np.ones(N, dtype=np.int64)

for _ in range(K):
    e_list_1 = np.zeros(N,dtype=np.int64)
    l_1 = np.zeros(N,dtype=np.int64)
    v = 0
    for i,a in enumerate(A_list):
        l_1[i] = v 
        e_list_1[min(i + a, N-1)] += 1
        v = v + 1 - e_list_1[i]
    
    e_list_2 = np.zeros(N,dtype=np.int64)
    l_2 = np.zeros(N,dtype=np.int64)
    v = 0
    for _i,a in enumerate(A_list[::-1]):
        i = N-1-_i
        l_2[i] = v
        e_list_2[max(i-a, 0)] += 1
        v = v + 1 - e_list_2[i]
    
    A_list = l_1 + l_2 + Base
print(*A_list)


### FIXED CODE ###

def main():
    N, K = map(int, input().split())
    A_list = list(map(int, input().split()))

    for _ in range(min(K,50)):
        e_list_1 = [0] * N
        l_1 = [0] * N
        v = 0
        for i,a in enumerate(A_list):
            l_1[i] = v 
            e_list_1[min(i + a, N-1)] += 1
            v = v + 1 - e_list_1[i]
        
        e_list_2 = [0] * N
        v = 0
        for _i,a in enumerate(A_list[::-1]):
            i = N-1-_i
            A_list[i] = l_1[i] + v + 1
            e_list_2[max(i-a, 0)] += 1
            v = v + 1 - e_list_2[i]
        
    print(*A_list)
if __name__ == "__main__":
    main()
### BUGGY CODE ###

from collections import deque
import copy
def solve(maze, start, end):
  memo = deque()
  q = deque()
  q.append([start,[]])
  ans = 0
  while q:
    cur, path = q.popleft()
    if cur == end:
      ans = path
      break
    elif cur in memo:
      continue
    else:
      memo.append(cur)
      for y, x in zip((0,0,1,-1),(1,-1,0,0)):
        if maze[cur[0]+y][cur[1]+x] == ".":
          q.append([[cur[0]+y,cur[1]+x],copy.deepcopy(path)+[cur]])
  return ans


H, W = map(int, input().split())
Maze = [["#"]*(W+2)]+[["#"]+list(input())+["#"] for _ in range(H)] + [["#"]*(W+2)]
Ans = 0
for sy in range(1, H+1):
  for sx in range(1, W+1):
    if Maze[sy][sx] == "#":
      continue
    memo = [[False]*(W+2) for _ in range(H+2)]
    for ey in range(sy, H+1):
      for ex in range(1, W+1):
        if Maze[ey][ex] == "#" or memo[ey][ex]:
          continue
        P = solve(Maze, [sy, sx], [ey,ex])
        Ans = max(Ans, len(P))
        for p in P:
          memo[p[0]][p[1]] = True
print(Ans)

### FIXED CODE ###

H, W = map(int, input().split())
S = [input() for _ in range(H)]


def f(i, j):
    t = [[-1] * W for _ in range(H)]
    t[i][j] = 0
    q = [(i, j)]
    while q:
        y, x = q.pop(0)
        if y - 1 >= 0 and S[y - 1][x] != '#' and t[y - 1][x] == -1:
            t[y - 1][x] = t[y][x] + 1
            q.append((y - 1, x))
        if y + 1 < H and S[y + 1][x] != '#' and t[y + 1][x] == -1:
            t[y + 1][x] = t[y][x] + 1
            q.append((y + 1, x))
        if x - 1 >= 0 and S[y][x - 1] != '#' and t[y][x - 1] == -1:
            t[y][x - 1] = t[y][x] + 1
            q.append((y, x - 1))
        if x + 1 < W and S[y][x + 1] != '#' and t[y][x + 1] == -1:
            t[y][x + 1] = t[y][x] + 1
            q.append((y, x + 1))
    return max(max(tt) for tt in t)


result = 0
for i in range(H):
    for j in range(W):
        if S[i][j] != '#':
            result = max(result, f(i, j))
print(result)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
h_list = input().split()
h_list = [int(h) for h in h_list]

count = 0

for i in range(n):
    a_height = h_list[i]
    for k in range(i + 1 + a_height, n):
        b_height = h_list[k]
        if k - i == a_height + b_height:
            count += 1

print(count)


### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
h_list = input().split()
h_list = [int(h) for h in h_list]

count = 0
result_dict = {}

for i in range(n):
    key = (i+1) + h_list[i]
    value = result_dict.get(key, 0)
    result_dict[key] = value + 1

for j in range(n):
    key = (j+1) - h_list[j]
    count += result_dict.get(key, 0)

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

import collections as cl

def get_median(arr) :
	
	idx = len(arr) + 1
	idx = int(idx / 2) - 1
	return arr[idx]

N = int(input())
X = [int(i) for i in input().split()]
X2 = X[:]
X2.sort(reverse=True)
dic = {}

for i in range(len(X)) :
	l = X2[:]
	key = l.pop(i)
	if (key not in dic) :
		dic[key] = get_median(l)

for i in X :
	print(dic[i])

### FIXED CODE ###

N = int(input())
X = [int(i) for i in input().split()]
X2 = sorted(X)
mapper = {}

for i in range(N//2) :
    if (X2[i] in mapper) :
        continue
    mapper[X2[i]] = X2[len(X2)//2]

for i in range(N//2,N) :
    if (X2[i] in mapper) :
        continue
    mapper[X2[i]] = X2[(len(X2)//2) - 1]

for x in X :
    print(mapper[x])
### BUGGY CODE ###

# D - FT Robot
# coding: utf-8

def check(d, to_d):
  meu = [0]
  for i in to_d:
    hoge = []
    for j in meu:
      hoge.append(j+i), hoge.append(j-i)
    meu = hoge
  return d in meu

S = [ len(F) for F in raw_input().split('T') ]
x, y = map(int, raw_input().split())
to_x, to_y = S[2::2], S[1::2]

print "Yes" if check(x-S[0],to_x) and check(y,to_y) else "No"

### FIXED CODE ###

# D - FT Robot
# coding: utf-8

def check(d, to_d):
  meu = set([0])
  for i in to_d:
    hoge = set([])
    for j in meu: hoge.add(j+i), hoge.add(j-i)
    meu = hoge
  return d in meu

S = map(len, raw_input().split('T'))
x, y = map(int, raw_input().split())
to_x, to_y = S[2::2], S[1::2]

print "Yes" if check(x-S[0],to_x) and check(y,to_y) else "No"
### BUGGY CODE ###

N, K, Q = [int(s) for s in input().split(' ')]
# A = [int(input()) for s in range(Q)]

# syoki_tokuten = [K for s in range(N)]
syoki_tokuten = [0] * N

# for i in A:
for ii in range(Q):
  i = int(input())
  syoki_tokuten[i-1] += 1
  
for i in range(N):
  genten = sum(syoki_tokuten) - syoki_tokuten[i]

  if genten < K:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

from collections import Counter 

N, K, Q = [int(s) for s in input().split(' ')]
A = [int(input()) - 1 for s in range(Q)]

c = Counter(A)

sum = sum(c.values())

for i in range(N):
  
  if sum - c[i] < K:
    print('Yes')
  else:
    print('No')