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

import queue
import copy

H,W = map(int,input().split())
c =[]
c.append(['×' for _ in range(W+2)])
ans = [[0 for _ in range(W+2)]for i in range(H+2)]

for i in range(H):
    tmp = list('×'+input()+'×')
    c.append(tmp)

c.append(['×' for _ in range(W+2)])

def bfs(x,y):
    q.put([x,y])

    while not q.empty():
        x,y = q.get()

        if c[y][x-1] == '#':
            return ans[y][x] + 1
        if c[y][x+1] == '#':
            return ans[y][x] + 1
        if c[y-1][x] == '#':
            return ans[y][x] + 1
        if c[y+1][x] == '#':
            return ans[y][x] + 1

        if c[y][x-1] == '.':
            q.put([x-1,y])
            ans[y][x-1] = ans[y][x] + 1
            c[y][x-1] = '×'
        if c[y][x+1] == '.':
            q.put([x+1,y])
            ans[y][x+1] = ans[y][x] + 1
            c[y][x+1] = '×'
        if c[y-1][x] == '.':
            q.put([x,y-1])
            ans[y-1][x] = ans[y][x] + 1
            c[y-1][x] = '×'
        if c[y+1][x] == '.':
            q.put([x,y+1])
            ans[y+1][x] = ans[y][x] + 1
            c[y+1][x] = '×'

c_copy = copy.deepcopy(c)
ans_copy = copy.deepcopy(ans)
max_ans = 0
for i in range(1,H+1):
    for j in range(1,W+1):
        if c[i][j] == '.':
            q = queue.Queue()
            max_ans = max(bfs(j,i),max_ans)
            c = copy.deepcopy(c_copy)
            ans = copy.deepcopy(ans_copy)

print(max_ans)


### FIXED CODE ###

from subprocess import call
call (('pypy3', '-c', """
from collections import deque

H,W = map(int,input().split())
c =[]
c.append(['×' for _ in range(W+2)])
ans = []
ans.append([0 for _ in range(W+2)])
q = deque()
for i in range(H):
    tmp = list('×'+input()+'×')
    ans_tmp = []
    for j in range(W+2):
        if tmp[j] == '#':
            ans_tmp.append(0)
            q.append([j,i+1])
        elif tmp[j] == '×':
            ans_tmp.append(0)
        else:
            ans_tmp.append(10**4)
    c.append(tmp)
    ans.append(ans_tmp)

c.append(['×' for _ in range(W+2)])
ans.append([0 for _ in range(W+2)])


def bfs(q):
    while q:
        x,y = q.popleft()
        if c[y][x-1] == '.':
            q.append([x-1,y])
            ans[y][x-1] = ans[y][x] + 1
            c[y][x-1] = '#'
        if c[y][x+1] == '.':
            q.append([x+1,y])
            ans[y][x+1] = ans[y][x] + 1
            c[y][x+1] = '#'
        if c[y-1][x] == '.':
            q.append([x,y-1])
            ans[y-1][x] = ans[y][x] + 1
            c[y-1][x] = '#'
        if c[y+1][x] == '.':
            q.append([x,y+1])
            ans[y+1][x] = ans[y][x] + 1
            c[y+1][x] = '#'

bfs(q)
max_ans = 0
for i in range(H+2):
    #print(ans[i])
    max_ans = max(max_ans,max(ans[i]))

print(max_ans)
"""))
### BUGGY CODE ###

import math

n = int(input())
s_list = []
n_list = []
ana = 0
for i in range(n):
    s = sorted(input())
    #print(s)
    if len(s_list) > 0:
        for num, s_i in enumerate(s_list):
            is_exist = False
            if s_i == s:
                n_list[num] += 1
                is_exist = True
                break
        if not is_exist:
            s_list.append(s)
            n_list.append(0)
    else:
        s_list.append(s)
        n_list.append(0)


for n_i in n_list:
    if n_i > 0:
        if n_i == 1:
            ana += 1
        else:
            ana += math.factorial(n_i+1) / math.factorial(n_i-1) / 2
print(int(ana))

### FIXED CODE ###

n = int(input())
s_dict = {}
ana = 0
for i in range(n):
    s = "".join(sorted(input()))
    #print(s)
    if s in s_dict:
        ana += s_dict[s]
        s_dict[s] += 1
    else:
        s_dict[s] = 1
        
print(ana)
### BUGGY CODE ###

N=int(input())
S=input()

count=0
for i in range(10):
    for j in range(10):
        for k in range(10):
            tmp_number=str(i) + str(j) + str(k)
            # print(tmp_number)
            itti_keta = 0
            for n in range(N):
                if S[n]==tmp_number[itti_keta]:
                    itti_keta+=1
                    if itti_keta==3:
                        break
            if itti_keta == 3:
                count+=1
print(count)


### FIXED CODE ###

N=int(input())
S=input()

count=0
for i in range(10):
    for j in range(10):
        for k in range(10):
            tmp_number=str(i) + str(j) + str(k)
            a = S.find(tmp_number[0])
            if a == -1:
                continue
            b = S[(a+1):].find(tmp_number[1])
            # print(S[a:])
            if b == -1:
                continue
            c = S[(a+b+2):].find(tmp_number[2])
            # print(S[(a+b):])
            if c == -1:
                continue
            count+=1
            # print(a,b,c)
            # print(tmp_number)
print(count)
### BUGGY CODE ###

import math

# input
#
# n = 5
# k = 10
# a = [1, 2, 3, 2, 3]

n, k = map(int, input().split())
a = [int(ai) for ai in input().split()]

# make jumpto
#
# 0 -> 6 (6)
# 1 -> 4 (3)
# 2 -> 5 (3)
# 3 -> 7 (4)
# 4 -> 8 (4)

jumpto = [[-1] * n]
la = -1
li = -1
for (ca, ci) in sorted(zip(a, range(n))):
    if ca == la:
        jumpto[0][ci] = jumpto[0][li] + li - ci
        jumpto[0][li] = ci - li + 1
    else:
        jumpto[0][ci] = n + 1
    la = ca
    li = ci

# doubling jumpto
#
# 0 -> 6 ->  9 (9)
# 1 -> 4 ->  8 (7)
# 2 -> 5 -> 11 (9)
# 3 -> 7 -> 10 (7)
# 4 -> 8 -> 12 (8)
#
# 0 -> 6 ->  9 -> 13 -> 17 (17)
# 1 -> 4 ->  8 -> 12 -> 15 (14)
# 2 -> 5 -> 11 -> 14 -> 18 (16)
# 3 -> 7 -> 10 -> 16 -> 19 (16)
# 4 -> 8 -> 12 -> 15 -> 21 (17)

levels = int(math.log(n * k, 2))
for l in range(1, levels + 1):
    jumpto.append([-1] * n)
    for i in range(n):
        f = jumpto[l - 1][i]
        s = jumpto[l - 1][(i + f) % n]
        jumpto[l][i] = f + s

# step1 and step2
ret = []
s = 0
while s < n * k:
    jumped = False
    for l in range(levels, -1, -1):
        if s + jumpto[l][s % n] <= n * k:
            s += jumpto[l][s % n]
            jumped = True
            break
    if not jumped:
        ret.append(str(a[s % n]))
        s += 1

print(' '.join(ret))


### FIXED CODE ###

import math

# input
#
# n = 5
# k = 10
# a = [1, 2, 3, 2, 3]

n, k = map(int, input().split())
a = [int(ai) for ai in input().split()]

# make jumpto
#
# 0 -> 6 (5)
# 1 -> 4 (2)
# 2 -> 5 (2)
# 3 -> 7 (3)
# 4 -> 8 (3)

jumpto = [[-1] * n]
la = -1
li = -1
for (ca, ci) in sorted(zip(a, range(n))):
    if ca == la:
        jumpto[0][ci] = jumpto[0][li] + li - ci
        jumpto[0][li] = ci - li
    else:
        jumpto[0][ci] = n
    la = ca
    li = ci

# doubling jumpto
#
# 0 -> 6 ->  9 (8)
# 1 -> 4 ->  8 (6)
# 2 -> 5 -> 11 (8)
# 3 -> 7 -> 10 (6)
# 4 -> 8 -> 12 (7)
#
# 0 -> 6 ->  9 -> 13 -> 17  (16)
# 1 -> 4 ->  8 -> 12 -> 15  (13)
# 2 -> 5 -> 11 -> 14 -> 18  (15)
# 3 -> 7 -> 10 -> 16 -> 19  (15)
# 4 -> 8 -> 12 -> 15 -> 21  (16)

levels = int(math.log(k, 2))
for l in range(1, levels + 1):
    jumpto.append([-1] * n)
    for i in range(n):
        f = jumpto[l - 1][i]
        s = jumpto[l - 1][(i + f + 1) % n]
        jumpto[l][i] = f + 1 + s

# step1
s = 0
while True:
    jumped = False
    for l in range(levels, -1, -1):
        if s + jumpto[l][s % n] < n * k:
            s += jumpto[l][s % n] + 1
            jumped = True
            break
    if not jumped:
        break

# step2
ret = []
while s < n * k:
    if s + jumpto[0][s % n] < n * k:
        s = s + jumpto[0][s % n] + 1
    else:
        ret.append(str(a[s % n]))
        s += 1

print(' '.join(ret))
### BUGGY CODE ###

def solve():
    a = read()
    result = think(a)
    write(result)


def read():
    n = read_int(1)[0]
    a = []
    for _ in range(n):
        a.append(read_int(1)[0])
    return a


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a):
    dummy = -1
    buttons_flash_info = list(a)
    buttons_flash_info.insert(0, dummy)

    index = 1
    visited = set()
    visited.add(index)
    push_count = 1
    while True:
        next_index = buttons_flash_info[index]
        index = next_index
        if index == 2:
            return push_count
        if index in visited:
            return -1
        push_count += 1
    return -1


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

### FIXED CODE ###

def solve():
    a = read()
    result = think(a)
    write(result)


def read():
    n = read_int(1)[0]
    a = []
    for _ in range(n):
        a.append(read_int(1)[0])
    return a


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a):
    dummy = -1
    flag_for_not_visited = 0
    flag_for_visited = 1

    buttons_flash_info = list(a)
    buttons_flash_info.insert(0, dummy)

    index = 1
    visited = [flag_for_not_visited for i in range(len(buttons_flash_info))]
    visited[index] = flag_for_visited
    push_count = 1
    while True:
        next_index = buttons_flash_info[index]
        index = next_index
        if index == 2:
            return push_count
        if visited[index] == flag_for_visited:
            return -1
        visited[index] = flag_for_visited
        push_count += 1
    return -1


def write(result):
    print(result)


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


def main():
    n, k = map(int, input().split(" "))
    p = list(map(int, input().split(" ")))
    ans = []
    for i in range(n-k+1):
        x = p[i:i+k]
        if sum(ans) < sum(x):
            ans = x
    a=0
    for i in range(k):
        a += 1+0.5*(ans[i]-1)
    print(a)


if __name__ == "__main__":
    main()

### FIXED CODE ###


def main():
    n, k = map(int, input().split(" "))
    p = list(map(int, input().split(" ")))
    u = [0]
    v = []
    w = []
    for i in range(n):
        u.append(u[i]+p[i])
    for i in range(n-k+1):
        w.append(u[k+i]-u[i])
    x = w.index(max(w))
    for i in range(k):
        v.append(p[x+i])
    a=0
    for i in range(k):
        a += 1+0.5*(v[i]-1)
    print(a)

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

import copy


def add2(l):
    ys = []
    for i in range(len(l)):
        ys += [l[i] + x for x in l[i+1:]]
    return ys


def add(n, l):
    if not l:
        return []
    elif n == 2:
        return add2(l)
    else:
        ys = [x for x in add(n, l[1:])]
        ys += [l[0] + x for x in add(n-1, l[1:])]
        return ys


def main():
    n, a = (int(x) for x in input().split())
    xs = [int(x) for x in input().split()]

    # i == 1
    ys = copy.deepcopy(xs)
    count = len(list(filter(lambda x: x == a, ys)))

    # i == 2 ~ n-2
    for i in range(2, n+1):
        ys = add(i, xs)
        count += len(list(filter(lambda x: x == a * i, ys)))
    '''
    # i == n-1
    ys = [sum(xs[:i]+xs[i+1:]) for i in range(n)]
    print(ys)
    count += len(list(filter(lambda x: x == a * (n - 1), ys)))

    # i == n
    if sum(xs) == n*a:
        count += 1
    '''
    print(count)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import numpy as np
n,avea=tuple(map(lambda x:int(x),input().split()))
x=list(map(lambda x:int(x), input().split()))
x=np.array(x)
x=x-avea
w=max(abs(min(x)),abs(max(x)))*n
dp=np.zeros((n+1,2*w+1),dtype=int)
dp[0,w]=1
for i in range(n):
    for j in range(2*w+1):
        if 0<=j-x[i]<=2*w:
            dp[i+1,j]=dp[i,j]+dp[i,j-x[i]]
        else:
            dp[i+1,j]=dp[i,j]
print(dp[n,w]-1)
### BUGGY CODE ###

def cal():
    from collections import deque
    h, w = map(int, input().split())
    a = [list(input()) for _ in range(h)]
    q = deque()
    counts = [[False for _ in range(w)] for _ in range(h)]
    loc = [(1, 0), (-1, 0), (0, 1), (0, -1)]
    
    for i in range(w):
        for j in range(h):
            if a[j][i] == '#':
                q.append([i, j, 0])
                counts[j][i] = True

    while q:
        x, y, z = q.popleft()
        for i, j in loc:
            x0 = x+j
            y0 = y+i
            if 0 <= x0 < w and 0 <= y0 < h:
                if not counts[y0][x0]:
                    counts[y0][x0] = True
                    q.append([x0, y0, z+1])
    return z

print(cal())


### FIXED CODE ###

from collections import deque

def cal():
    h, w = map(int, input().split())
    q = deque()
    counts = [[True for _ in range(w+2)]]+[[True]+[False]*w+[True] for _ in range(h)]+[[True for _ in range(w+2)]]
    for i in range(h):
        a = input()
        for j in range(w):
            if a[j] == '#':
                q.append([i+1, j+1, 0])
                counts[i+1][j+1] = True

    while q:
        x, y, z = q.popleft()    
        if not counts[x+1][y]:
            counts[x+1][y] = True
            q.append([x+1, y, z+1])
        if not counts[x-1][y]:
            counts[x-1][y] = True
            q.append([x-1, y, z+1])
        if not counts[x][y+1]:
            counts[x][y+1] = True
            q.append([x, y+1, z+1])
        if not counts[x][y-1]:
            counts[x][y-1] = True
            q.append([x, y-1, z+1])
    print(z)
    

cal()
### BUGGY CODE ###

from math import floor
A,B,N = map(int,input().split())
ans = []
for x in range(min(B+1,N+1)):
    ans.append(floor((A*x)/B)-A*floor(x/B))
print(max(ans))


### FIXED CODE ###

from math import floor
A,B,N = map(int,input().split())
x = min(B-1,N)
print(floor(A*x/B)-A*floor(x/B))
### BUGGY CODE ###

def main():
  h, w = map(int, input().split())
  s = [input() + '#' for _ in range(h)]
  s.append('#' * (w + 1))

  yoko = [[0] * w for _ in range(h)]
  tate = [[0] * w for _ in range(h)]

  tstart = [-1] * (w + 1)
  for i in range(h + 1):
    si = s[i]
    ystart = -1
    for j in range(w + 1):
      if si[j] == '#':
        if ystart != -1:
          for k in range(ystart, j):
            yoko[i][k] = j - ystart
          ystart = -1
        if tstart[j] != -1:
          for k in range(tstart[j], i):
            tate[k][j] = i - tstart[j]
          tstart[j] = -1
      else:
        if ystart == -1:
          ystart = j
        if tstart[j] == -1:
          tstart[j] = i

  result = 0
  for i in range(h):
    yokoi = yoko[i]
    tatei = tate[i]
    for j in range(w):
      t = yokoi[j] + tatei[j] - 1
      if t > result:
        result = t

  print(result)

main()

### FIXED CODE ###

h, w = map(int, input().split())
s = [input() + '#' for _ in range(h)]
s.append('#' * w)

yoko = [[0] * w for _ in range(h)]
for i in range(h):
  if s[i][0] == '.':
    start = 0
  else:
    start = -1
  for j in range(1, w + 1):
    if s[i][j] == '#':
      if start != -1:
        for k in range(start, j):
          yoko[i][k] = j - start
        start = -1
    else:
      if start == -1:
        start = j

tate = [[0] * w for _ in range(h)]
for i in range(w):
  if s[0][i] == '.':
    start = 0
  else:
    start = -1
  for j in range(1, h + 1):
    if s[j][i] == '#':
      if start != -1:
        for k in range(start, j):
          tate[k][i] = j - start
        start = -1
    else:
      if start == -1:
        start = j
result = 0
for i in range(h):
  for j in range(w):
    t = yoko[i][j] + tate[i][j] - 1
    if t > result:
      result = t

print(result)
### BUGGY CODE ###

import collections
import math
N = int(input())
A = list(map(int, input().split()))
c = collections.Counter(A)


for i in A:
  ans = 0
  for j in c.keys():
    if c[j] >1:
      k = c[j]
      if j == i:
        if c[j]>2:
          k -= 1
          ans += math.factorial(k) // (math.factorial(k-2) * math.factorial(2))
      else:
        ans += math.factorial(k) // (math.factorial(k-2) * math.factorial(2))
  print(ans)


### FIXED CODE ###

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

import collections
c = collections.Counter(A)
a = 0

for i,j in c.items():
    a += j *(j-1) //2
#print('===', a)
for k in range(n):
    nn = c[A[k]]
    ans = a -(nn-1)
    print(ans)
### BUGGY CODE ###

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

bamboos = []
for _ in range(N):
    l = int(input())
    bamboos.append(l)
    
ABC = [A, B, C]

import itertools
import sys

ans = sys.maxsize
executed = set()
for i in range(3, N+1):
    for bamboos_rearranged in itertools.permutations(bamboos, i):
        #print(bamboos_rearranged)
        execute = ','.join(map(str,bamboos_rearranged))
        if execute in executed:
            continue
        else:
            executed.add(execute)
        for j in range(1, len(bamboos_rearranged)):
            for k in range(j+1, len(bamboos_rearranged)):
                bamboos_abc = (bamboos_rearranged[:j], bamboos_rearranged[j:k], bamboos_rearranged[k:])
                cost = 0
                for n, b in enumerate(bamboos_abc):
                    cost += (len(b) - 1) * 10
                    cost += abs(ABC[n] - sum(b))
                ans = min(ans, cost)
print(ans)
        
    

### FIXED CODE ###

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

bamboos = []
for _ in range(N):
    l = int(input())
    bamboos.append(l)
    
import copy

def dfs(i, bs):
    if i == len(bamboos):
        #print(bs)
        if not bs['A'] or not bs['B'] or not bs['C']:
            return []
        return [bs]
    ret = []
    tmp = copy.deepcopy(bs)
    tmp['A'].append(bamboos[i])
    ret.extend(dfs(i+1, tmp))
    tmp = copy.deepcopy(bs)
    tmp['B'].append(bamboos[i])
    ret.extend(dfs(i+1, tmp))
    tmp = copy.deepcopy(bs)
    tmp['C'].append(bamboos[i])
    ret.extend(dfs(i+1, tmp))
    tmp = copy.deepcopy(bs)
    tmp['D'].append(bamboos[i])
    ret.extend(dfs(i+1, tmp))
    
    return ret

ABC = {'A': A, 'B': B, 'C': C}
bs_comb = dfs(0, {'A':[],'B':[],'C':[],'D':[]})

import sys
ans = sys.maxsize
for bs in bs_comb:
    cost = 0
    for abc in ['A', 'B', 'C']:
        cost += (len(bs[abc]) - 1) * 10
        cost += abs(sum(bs[abc]) - ABC[abc])
    ans = min(ans, cost)
print(ans)
### BUGGY CODE ###

input_s = input()
len_s = len(input_s)
ans = 0

for digit in range(4, len_s):
    for i in range(len_s - digit):
        j = i + digit
        if (int(input_s[i:j+1]) % 2019) == 0:
            ans += 1
            i = j

print(ans)


### FIXED CODE ###

s = input()[::-1]
n = len(s)
x = 1
tot = 0 # 累積和
cnt = [0 for i in range(2019)] # 累積和の値になる個数

ans = 0
for i in range(n):
    # print('======={}======'.format(i))
    cnt[tot] += 1
    tot += int(s[i])*x
    # print(tot)
    tot %= 2019
    # print(tot)
    ans += cnt[tot]
    # print('ans:', ans)
    x = x*10%2019

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

from collections import deque
H, W = map(int, input().split())
maze = [input()for _ in range(H)]


def bfs(queue: deque, reached: set) -> int:
    ans = 0
    dxdy = [[1, 0], [-1, 0], [0, 1], [0, -1]]
    while queue:
        d = queue.pop()
        if ans < d[2]:
            ans = d[2]
        for a in dxdy:
            x = d[0] + a[0]
            y = d[1] + a[1]
            if (x, y) not in reached and 0 <= x < W and 0 <= y < H:
                queue.appendleft((x, y, d[2] + 1))
                reached.add((x, y))
    return ans


queue = deque()
reached = set()
for i in range(H):
    for j in range(W):
        if maze[i][j] == '#':
            queue.append((j, i, 0))
            reached.add((j, i))
print(bfs(queue, reached))

### FIXED CODE ###

from collections import deque
H, W = map(int, input().split())
maze = [input()for _ in range(H)]


def bfs(queue: deque, reached: set) -> int:
    ans = 0
    dxdy = [[1, 0], [-1, 0], [0, 1], [0, -1]]
    while queue:
        d = queue.pop()
        if ans < d[2]:
            ans = d[2]
        for a in dxdy:
            x = d[0] + a[0]
            y = d[1] + a[1]
            if 0 <= x < W and 0 <= y < H and not reached[y][x]:
                queue.appendleft((x, y, d[2] + 1))
                reached[y][x] = True
    return ans


queue = deque()
reached = [[False for i in range(W)] for j in range(H)]
for i in range(H):
    for j in range(W):
        if maze[i][j] == '#':
            queue.append((j, i, 0))
            reached[i][j] = True
print(bfs(queue, reached))
### BUGGY CODE ###

n = int(input())
list_a = []
for i in range(0,n):
    list_a.append(int(input()))
def search(number):
    for i in range(0,n):
        if list_a[i] == number:
            return i + 1
number = 2
count = 0
while True:
    number = search(number)
    count += 1
    if number == 1:
        print(count)
        break
    if count > n:
        print(-1)
        break


### FIXED CODE ###

n = int(input())
list_a = []
for i in range(0,n):
    list_a.append(int(input()))
number = 0
count = 0
while True:
    number = list_a[number] - 1        
    count += 1
    if number == 1:
        print(count)
        break
    if count > n:
        print(-1)
        break
### BUGGY CODE ###

N = int(input())
slist = list(map(int, input().split()))
ans = 0
for C in range(1,N-1,1):
    flg = [False for i in range(N)]
    score = 0
    for k in range((N-1)//C):
        if flg[k*C] or flg[N-1-k*C]: #今までに通った
            break
        if 2*k*C == N-1: #選ぶ二つが同じところ
            break
        score += slist[k*C]+slist[N-1-k*C]
        ans = max(ans, score)
        flg[k*C] = True
        flg[N-1-k*C] = True
print(ans)

### FIXED CODE ###

N = int(input())
slist = list(map(int, input().split()))
ans = 0
for C in range(1,N-1,1):
    score = 0
    for k in range((N-1)//C):
        if (k-1)*C == N-1-k*C: #一つ前に選んだところ
            break
        if 2*k*C == N-1: #今から選ぶ二つが同じところ
            break
        score += slist[k*C]+slist[N-1-k*C]
        ans = max(ans, score)
print(ans)
### BUGGY CODE ###

n,k,q = map(int,input().split())
score = [k for i in range(n)]
a_i = [int(input())-1 for i in range(q)]

for i in range(len(a_i)):
    for j in range(len(score)):
        if(a_i[i] == j):
            score[j] += 0
        else:
            score[j] -= 1
    
for i in score:
    if(i > 0):
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

import sys
n,k,q = map(int,input().split())
score = [k-q for i in range(n)]
a_i = [int(input())-1 for i in range(q)]


for i in range(len(a_i)):
    score[a_i[i]] += 1



for i in score:
    if(i > 0):
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

n = int(input())
s = [list(input()) for i in range(n)]
ans = 0
for a in range(n):
    check = True
    for x in range(n):
        for y in range(x):
            if s[(x+a)%n][y] != s[(y+a)%n][x]:
                check = False
                break
        if check == False:
            break
    if check:
        ans += n
    
print(ans)

### FIXED CODE ###

n = int(input())
s = [list(input()) for i in range(n)]
ans = 0
for a in range(n):
    check = True
    for x in range(n):
        for y in range(x):
            if s[(x+a)%n][y] != s[(y+a)%n][x]:
                check = False
                break
        if check == False:
            break
    if check:
        ans += n-a
    if a == 0:
        continue
    check = True
    for x in range(n):
        for y in range(x):
            if s[x][(y+a)%n] != s[y][(x+a)%n]:
                check = False
                break
        if check == False:
            break
    if check:
        ans += n-a
print(ans)
### BUGGY CODE ###

import bisect
n = int(input())
l = sorted(list(map(int, input().split())))
ans = 0
for i in range(n):
  a = l[i]
  for j in range(i + 1, n):
    b = l[j]
    ans += bisect.bisect_left(l, b+a, lo = j + 1)-j-1
print(ans)

### FIXED CODE ###

import bisect
n = int(input())
l = sorted(list(map(int,input().split())))
ans = 0
 
for i in range(n-2):
    for j in range(i+1, n-1):
        ans += bisect.bisect_left(l,l[i] + l[j]) - j - 1
print(ans)