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


import math


def fact(x):
    for cand in range(2, math.ceil(math.sqrt(x)) + 1):
        q, r = divmod(x, cand)
        if r == 0:
            return min(q, cand), max(q, cand)
    return 1, x


# def check(a, b):
#     a2 = a * a
#     a3 = a2 * a
#     a4 = a3 * a
#     b2 = b * b
#     b3 = b2 * b
#     b4 = b3 * b
#     return a4 + a3*b + a2*b2 + a*b3 + b4

def pow5(x):
    return x ** 5


def func(a, b):
    return pow5(a) - pow5(b)


def submit():
    x = int(input())

    if x == 1:
        print("0 -1")
        return

    q1, q2 = fact(x)
    # パターン2 a > 0, b < 0
    a = q1
    b = 0
    f = func(a, b)
    while a > 0 and f != x:
        a -= 1
        b -= 1
        f = func(a, b)
    if f == x:
        print("{} {}".format(a, b))
        return

    # パターン1, a, b > 0
    a = q1
    b = 0
    f = func(a, b)
    while f < x:
        a += 1
        b += 1
        f = func(a, b)
    if f == x:
        print("{} {}".format(a, b))
        return

    # パターン3 a, b < 0
    a = 0
    b = -q1
    f = func(a, b)
    while f != x:
        a -= 1
        b -= 1
        f = func(a, b)
    if f == x:
        print("{} {}".format(a, b))
        return

        
submit()

### FIXED CODE ###



def submit():
    x = int(input())

    for a in range(-200, 200):
        for b in range(-200, 200):
            if a ** 5 - b ** 5 == x:
                print(a, b)
                return


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

def main():
    import sys
    input=sys.stdin.readline
    sys.setrecursionlimit(100000)
    s=input()
    l=len(s)
    alpha="abcdefghijklmnopqrstuvwxyz"
    alpha2={j:i for i,j in enumerate(alpha)}
    memo=[[0]*26 for _ in range(l,-1,-1)]
    for i in range(26):
        memo[l][i]=l+1
    for x,y in alpha2.items():
        for i in range(l-1,-1,-1):
            if s[i]==x:
                memo[i][y]=i+1
            else:
                memo[i][y]=memo[i+1][y]
    def search(n,seq):
        if n==l+1:
            return seq
        temp=-1
        for i in range(26):
            if memo[n][i]>temp:
                temp=memo[n][i]
        return search(temp,seq+1)
    ans_len=search(0,0)
    ans=""
    temp=0
    for i in range(ans_len):
        for j in range(26):
            ls=search(memo[temp][j],i+1)
            if ls==ans_len:
                ans+=alpha[j]
                temp=memo[temp][j]
                break
    print(ans)
if __name__=='__main__':
    main()

### FIXED CODE ###

def main():
    import sys
    input=sys.stdin.readline
    s=input()
    alpha="abcdefghijklmnopqrstuvwxyz"
    l=len(s)
    alpha2={j:i for i,j in enumerate(alpha)}
    memo=[[0]*26 for _ in range(l,-1,-1)]
    for i in range(26):
        memo[l][i]=l+1
    for x,y in alpha2.items():
        for i in range(l-1,-1,-1):
            if s[i]==x:
                memo[i][y]=i+1
            else:
                memo[i][y]=memo[i+1][y]
    
    search=[1]*(l+2)
    search[l+1]=0
    for i in range(l-1,-1,-1):
        m=max([memo[i][j] for j in range(26)])
        if m!=l+1:
            search[i]=search[m]+1
    
    n,seq=0,0
    ans_len=search[0]
    ans=""
    temp=0
    for i in range(ans_len):
        for j in range(26):
            n=memo[temp][j]
            seq=search[n]+i
            if seq+1==ans_len:
                ans+=alpha[j]
                temp=memo[temp][j]
                break
    print(ans)
if __name__=='__main__':
    main()
### BUGGY CODE ###

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)


# Priority QueueとしてHeapを使う
# Pythonのheapqは小さい順に取り出すので、-1を掛けて負数としてpushしていく
#   (-Ai-Bj-Ck, i, j, k)
# 取り出したi, j, kについて、(i+1, j, k), (i, j+1, k), (i, j, k+1)に対応するタプルをpushする
# ただし、すでにpushした値は入れないようにする

import heapq



def make(i, j, k):
    return (-A[i]-B[j]-C[k], i, j, k)

class flags:
    def __init__(self, X, Y, Z):
        self.ar = []
        for k in range(X):
            l = []
            for j in range(Y):
                ll = []
                for i in range(Z):
                    ll.append(False)
                l.append(ll)
            self.ar.append(l)
        
    def __getitem__(self, item):
        return self.ar[item[0]][item[1]][item[2]]
    
    def __setitem__(self, item, value):
        self.ar[item[0]][item[1]][item[2]] = value
        

used = flags(X,Y,Z)
def push_next(l, i, j, k):
    if i < X - 1 and not used[i+1, j, k]:
        heapq.heappush(l, make(i+1, j, k))
        used[i+1, j, k] = True
    
    if j < Y - 1 and not used[i, j+1, k]:
        heapq.heappush(l, make(i, j+1, k))
        used[i, j+1, k] = True
    
    if k < Z - 1 and not used[i, k, k+1]:
        heapq.heappush(l, make(i, j, k+1))
        used[i, j, k+1] = True



l = []

heapq.heappush(l, make(0, 0, 0))
used[0, 0, 0] = True

for cnt in range(K):
    V, i, j, k = heapq.heappop(l)
    push_next(l, i, j, k)
    
    print(-V)




### FIXED CODE ###

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)


# Priority QueueとしてHeapを使う
# Pythonのheapqは小さい順に取り出すので、-1を掛けて負数としてpushしていく
#   (-Ai-Bj-Ck, i, j, k)
# 取り出したi, j, kについて、(i+1, j, k), (i, j+1, k), (i, j, k+1)に対応するタプルをpushする
# ただし、すでにpushした値は入れないようにする

import heapq

def make(i, j, k):
    return (-A[i]-B[j]-C[k], i, j, k)


used = set()
l = []

heapq.heappush(l, make(0, 0, 0))
used.add((0, 0, 0))

for cnt in range(K):
    V, i, j, k = heapq.heappop(l)
    
    if i < X - 1 and (i+1, j, k) not in used:
        heapq.heappush(l, make(i+1, j, k))
        used.add((i+1, j, k))
    
    if j < Y - 1 and (i, j+1, k) not in used:
        heapq.heappush(l, make(i, j+1, k))
        used.add((i, j+1, k))
    
    if k < Z - 1 and (i, j, k+1) not in used:
        heapq.heappush(l, make(i, j, k+1))
        used.add((i, j, k+1))
    
    print(-V)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**6)
def f(a,*b):
    if len(b)>1:
        return f(a,f(*b))
    b=b[0]
    if b:
        return f(b,a%b)
    return a
n=int(input())
a=list(map(int,input().split()))
print(f(*a))


### FIXED CODE ###

def f(a,b):
    if b:
        return f(b,a%b)
    return a
n=int(input())
a=list(map(int,input().split()))
p=f(a[0],a[1])
for i in a:
    p=f(p,i)
print(p)
### BUGGY CODE ###

from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
res = [0] * (n+1)
ans = 0
for i in range(1,n+1):
    for j in range(1,n+1):
        if i*j > n: break
        res[i*j] += 1
    ans += i*res[i]
print(ans)

### FIXED CODE ###

from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
ans = [0] * (n+1)
for i in range(1,n+1):
    for j in range(1,n+1):
        if i*j > n: break
        ans[i*j] += 1
res = 0
for i in range(1,n+1):
    res += i*ans[i]
print(res)
### BUGGY CODE ###

#coding: utf-8

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

if N % K == 0:
    print(0)
elif abs(N-K) < N:
    while True:
        N_ = abs(N-K)
        if N_ <= N:
            N = N_
        else:
            break
    print(N)

elif abs(N-K) >= N:
    if N >= K:
        print(N%K)
    else:
        print(N)
else:
    print('jj')

### FIXED CODE ###

#coding: utf-8

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

if N % K == 0:
    print(0)
elif abs(N-K) < N:
    N = N % K
    while True:
        N_ = abs(N-K)
        if N_ < N:
            N = N_
        else:
            break
    print(N)

elif abs(N-K) >= N:
    if N >= K:
        print(N%K)
    else:
        print(N)
### BUGGY CODE ###

H,W = map(int,input().split())
maze = []
for i in range(H):
    s = list(input())
    maze.append(s)

def clear_maze(sx, sy, gx, gy, maze):
    INF = 100000000
    distance = [[INF for i in range(W)] for j in range(H)]
    #    distance = [[None]*field_x_length]*field_y_length

    def bfs():
        queue = []
        queue.insert(0, (sx, sy))
        distance[sx][sy] = 0

        while len(queue):
            x, y = queue.pop()

            if x == gx and y == gy:
                break

            for i in range(0, 4):
                nx, ny = x + [1, 0, -1, 0][i], y + [0, 1, 0, -1][i]

                if 0 <= nx and nx < H and 0 <= ny and ny < W and maze[nx][ny] != '#' and distance[nx][ny] == INF:
                        queue.insert(0, (nx, ny))
                        distance[nx][ny] = distance[x][y] + 1


        return distance[gx][gy]

    return bfs()

ans = 0
for sx in range(H):
    for sy in range(W):
        if maze[sx][sy] == ".":
            for gx in range(H):
                for gy in range(W):
                    if maze[gx][gy] == ".":
                        if clear_maze(sx,sy,gx,gy,maze) > ans:
                            ans = clear_maze(sx,sy,gx,gy,maze)

print(ans)

### FIXED CODE ###

from collections import deque

def BFS(x,y):
    dist = 1
    visited = deque()
    visited.append((x,y))
    destination = deque()
    search = [(1,0),(-1,0),(0,1),(0,-1)]
    for (dx,dy) in search:
        if maze[y+dy][x+dx] == ".":
            destination.append((x+dx,y+dy))
    same_dist = len(destination)
    moved = 0
    x = destination[0][0]
    y = destination[0][1]
    while destination:
        visited.append((x,y))
        destination.popleft()
        for (dx,dy) in search:
            if maze[y+dy][x+dx] == ".":
                if (x+dx,y+dy) not in destination and (x+dx,y+dy) not in visited:
                    destination.append((x+dx,y+dy))
        if len(destination) >= 1:
            x = destination[0][0]
            y = destination[0][1]
            moved += 1
            if moved == same_dist:
                dist += 1
                moved = 0
                same_dist = len(destination)
    return dist

H,W = map(int,input().split())
maze = [list("#"*(W+2))] + [list("#" + input() + "#") for i in range(H)] + [list("#"*(W+2))]
ans = 0

for y in range(1,H+1):
    for x in range(1,W+1):
        if maze[y][x] == ".":
            ans = max(ans,BFS(x,y))

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

from collections import deque
  
n = int(input())
dll = deque()
  
for i in range(n):
    input_line = [str(s) for s in input().split()]
    if input_line[0] == "insert":
        dll.appendleft(input_line[1])
    elif input_line[0] == "delete":
        try:
            dll.remove(input_line[1])
        except:
            pass
    elif input_line[0] == "deleteFirst":
        dll.popleft()
    else:
        dll.pop()
          
print(*dll)

### FIXED CODE ###

from collections import deque
   
n = int(input())
dll = deque()
   
for i in range(n):
    input_line = input().split()
    if input_line[0] == "insert":
        dll.appendleft(input_line[1])
    elif input_line[0] == "delete":
        try:
            dll.remove(input_line[1])
        except:
            pass
    elif input_line[0] == "deleteFirst":
        dll.popleft()
    else:
        dll.pop()
           
print(*dll)
### BUGGY CODE ###

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

mod = 10 ** 9 + 7

if S[0] == "W" or S[-1] == "W":
    print(0)
    exit()

ans = 1
T = [True] * 2 * N
prev = S[0]
t_sum = 1
f_sum = 0
for i in range(1, 2*N-1):
    if S[i] == prev:
        T[i] = not T[i-1]
    else:
        T[i] = T[i-1]
    prev = S[i]

    if T[i]:
        t_sum += 1
    else:
        ans *= (t_sum - f_sum)
        f_sum += 1

if t_sum != N:
    ans = 0

for i in range(1, N+1):
    ans *= i
    ans %= mod

print(ans)

### FIXED CODE ###

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

mod = 10 ** 9 + 7

if S[0] == "W" or S[-1] == "W":
    print(0)
    exit()

ans = 1
prev_s = S[0]
prev_t = True
t_sum = 1
f_sum = 0
for i in range(1, 2*N-1):
    if S[i] == prev_s:
        t = not prev_t
    else:
        t = prev_t

    if t:
        t_sum += 1
    else:
        ans *= (t_sum - f_sum)
        ans %= mod
        f_sum += 1
    prev_s = S[i]
    prev_t = t

if t_sum != N:
    ans = 0

for i in range(1, N+1):
    ans *= i
    ans %= mod

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

n = int(input())
s = [input() for _ in range(n)]

items = []

for i in range(n):
    new = True
    for j in range(len(items)):
        if s[i] == items[j]:
            new = False
    if new:
        items.append(s[i])
    
print(len(items))


### FIXED CODE ###

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

print(len(set(S)))
### BUGGY CODE ###

import numpy as np
N, W = map(int, input().split())
weight = []
value = []
for _ in range(N):
    w, v = map(int, input().split())
    weight.append(w)
    value.append(v)
value_sum = sum(value)
dp = [[float('inf') for _ in range(value_sum + 1)] for _ in range(N + 1)]
dp = np.full((N + 1, value_sum + 1), float('inf'))
dp[0][0] = 0
# print(dp)
for idx in range(N):
    for v in range(value_sum + 1):
        if value[idx] <= v:
            dp[idx + 1][v] = min(dp[idx][v], dp[idx][v - value[idx]] + weight[idx])
        else:
            dp[idx + 1][v] = dp[idx][v]
ans = 0
# print(dp)
for i in range(value_sum + 1):
    if dp[N][i] <= W:
        ans = i
print(ans)

### FIXED CODE ###

N, W = map(int, input().split())
weight = []
value = []
for _ in range(N):
    w, v = map(int, input().split())
    weight.append(w)
    value.append(v)
value_sum = sum(value)
dp = []
for _ in range(N + 1):
    dp_val = [float('inf') for _ in range(value_sum + 1)]
    dp.append(dp_val)
dp[0][0] = 0

for idx in range(N):
    for v in range(value_sum + 1):
        if value[idx] <= v:
            dp[idx + 1][v] = min(dp[idx][v], dp[idx][v - value[idx]] + weight[idx])
        else:
            dp[idx + 1][v] = dp[idx][v]
ans = 0
# print(dp)
for i in range(value_sum + 1):
    if dp[-1][i] <= W:
        ans = i
print(ans)
### BUGGY CODE ###

n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
for i in range(n):
    if i==a.index(max(a)):
        print(max(a[:i]+a[i+1:]))
    else:
        print(max(a))

### FIXED CODE ###

n=int(input())
a=[int(input()) for i in range(n)]
A,B=sorted(a,reverse=True)[0:2]
for i in range(n):
    if a[i]==A:
        print(B)
    else:
        print(A)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(2147483647)

h,w=map(int,input().split())
s=list(input() for _ in range(h))

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

def yoko_check(y,x,cnt):
    global yoko,s
    if x==w-1:
        yoko[y][x]=cnt
        return cnt
    else:
        if s[y][x+1]=="#":
            yoko[y][x]=cnt
            return cnt
        else:
            yoko[y][x]=yoko_check(y,x+1,cnt+1)
            return yoko[y][x]


def tate_check(y,x,cnt):
    global tate,s
    if y==h-1:
        tate[y][x]=cnt
        return cnt
    else:
        if s[y+1][x]=="#":
            tate[y][x]=cnt
            return cnt
        else:
            tate[y][x]=tate_check(y+1,x,cnt+1)
            return tate[y][x]


for y in range(h):
    for x in range(w):
        if yoko[y][x]==0 and s[y][x]==".":
            yoko_check(y,x,1)
        if tate[y][x]==0 and s[y][x]==".":
            tate_check(y,x,1)

#print(tate)

result=0
for y in range(h):
    for x in range(w):
        if s[y][x]==".":
            result=max(result,tate[y][x]+yoko[y][x]-1)  

print(result)  


### FIXED CODE ###

import sys
sys.setrecursionlimit(2147483647)

h,w=map(int,input().split())
s=list(input() for _ in range(h))

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

def yoko_check(y,x,cnt):
    global yoko,s
    if x==w-1:
        yoko[y][x]=cnt
        return cnt
    else:
        if s[y][x+1]=="#":
            yoko[y][x]=cnt
            return cnt
        else:
            yoko[y][x]=yoko_check(y,x+1,cnt+1)
            return yoko[y][x]


def tate_check(y,x,cnt):
    global tate,s
    if y==h-1:
        tate[y][x]=cnt
        return cnt
    else:
        if s[y+1][x]=="#":
            tate[y][x]=cnt
            return cnt
        else:
            tate[y][x]=tate_check(y+1,x,cnt+1)
            return tate[y][x]


for y in range(h):
    for x in range(w):
        if yoko[y][x]==0 and s[y][x]==".":
            yoko_check(y,x,1)
        if tate[y][x]==0 and s[y][x]==".":
            tate_check(y,x,1)

#print(tate)

result=0
for y in range(h):
    for x in range(w):
        if s[y][x]==".":
            result=max(result,tate[y][x]+yoko[y][x]-1)  

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

import sys
import os
import math
import bisect
import collections

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(A, B, x):
    return math.floor(A * x / B) - A * math.floor(x / B)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B, N = il()
    ret = 0
    for n in range(1, N + 1):
        ret = max(ret, f(A, B, n))
    print(ret)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import os
import math
import bisect
import collections
import itertools

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def f(A, B, x):
    return math.floor(A * x / B) - A * math.floor(x / B)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B, N = il()
    print(f(A, B, min(B - 1, N)))


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

N = int(input())
A = list(input().split())
cnt = 0
for i in range(1,N+1):
    print(A.index(str(i))+1, end=' ')

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ls = [0]*N
for i,x in enumerate(A):
    ls[x-1] = str(i+1)
print(' '.join(ls))
### BUGGY CODE ###

#!/usr/bin/env python3
import sys
input = sys.stdin.readline

def main():
    R, C, K = map(int, input().split())
    D = {}
    for _ in [None] * K:
        r, c, v = map(int, input().split())
        D[(r - 1, c - 1)] = v

    dp = [[[-1] * C for _ in [None] * R] for _ in [None] * 4]

    dp[0][0][0] = 0
    for r in range(R):
        for c in range(C):
            v = D.get((r, c), None)
            for i in range(4):
                if dp[i][r][c] > -1:
                    if r < R - 1:
                        dp[0][r + 1][c] = max(dp[0][r + 1][c], dp[i][r][c])
                    if c < C - 1:
                        dp[i][r][c + 1] = max(dp[i][r][c + 1], dp[i][r][c])
                    if i < 3 and v:
                        if r < R - 1:
                            dp[0][r + 1][c] = max(dp[0][r + 1][c], dp[i][r][c] + v)
                        if c < C - 1:
                            dp[i + 1][r][c + 1] = max(dp[i + 1][r][c + 1], dp[i][r][c] + v)

    v = D.get((R - 1, C - 1), 0)
    ans = dp[3][R - 1][C - 1]
    for i in range(3):
        ans = max(ans, dp[i][R - 1][C - 1] + v)
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

def solve():
    input = sys.stdin.readline
    R, C, K = map(int, input().split())
    item = [[0 for _ in range(C)] for r in range(R)]
    for _ in range(K):
        r, c, k = map(int, input().split())
        item[r-1][c-1] = k
    
    DP = [[[-1 for _ in range(C)] for r in range(R)] for i in range(4)]
    DP[0][0][0] = 0
    for r in range(R):
        for c in range(C):
            for i in range(4):
                if DP[i][r][c] > -1:
                    if r + 1 < R: 
                        DP[0][r+1][c] = max(DP[0][r+1][c], DP[i][r][c])
                    if c + 1 < C: 
                        DP[i][r][c+1] = max(DP[i][r][c+1], DP[i][r][c])
                    if i < 3 and item[r][c] > 0:
                        if r + 1 < R: DP[0][r+1][c] = max(DP[0][r+1][c], DP[i][r][c] + item[r][c])
                        if c + 1 < C: DP[i+1][r][c+1] = max(DP[i+1][r][c+1], DP[i][r][c] + item[r][c])

    ans = DP[3][R-1][C-1]
    for i in range(3): ans = max(ans, DP[i][R-1][C-1] + item[R-1][C-1])
    print(ans)
    return 0

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

import sys
N,K,Q = map(int,input().split())
if K > Q:
    for i in range(N):
        print('Yes')
    sys.exit(0)
else:
  res = dict()
  for i in range(Q):
    answ = int(input())
    if answ not in res:
      res[answ] = 0
    res[answ] += 1
res2 = []
for key in res:
    if res[key] >= (Q-K+1):
        res2.append(key)
for i in range(1,N+1):
  if i in res2:
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

import sys
N,K,Q = map(int,input().split())
if K > Q:
    for i in range(N):
        print('Yes')
    sys.exit(0)
else:
  res = dict()
  for i in range(N+1):
      res[i] = 0
  for i in range(Q):
    answ = int(input())
    if answ not in res:
      res[answ] = 0
    res[answ] += 1
res2 = [answ[0] for answ in res.items() if answ[1] >= (Q-K+1)]
for i in res2:
    res[i] = -1
for i in range(1,N+1):
    if (res[i] == -1):
        print('Yes')
    else:
        print('No')
### BUGGY CODE ###

N=int(input())
S=input()
count=0
for k in range(3,N+1):
    for j in range(2,k):
        if S[j-1]!=S[k-1]:
            for i in range(1,j):
                if S[i-1]!=S[j-1] and S[k-1]!=S[i-1] and j-i!=k-j:
                    count+=1
print(count)


### FIXED CODE ###

N=int(input())
S=input()
count=0
nocount=0
Rcount=0
Gcount=0
Bcount=0
for k in range(N):
    if S[k]=="R":
        Rcount+=1
    if S[k]=="G":
        Gcount+=1
Bcount = N -Rcount-Gcount
count=Rcount*Gcount*Bcount
for k in range(3,N+1):
    if k%2==1:
        for i in range(1,k-1,2):
            if S[i-1]!=S[k-1]:
                j=(i+k)//2
                if S[i-1]!=S[j-1] and S[k-1]!=S[j-1]:
                    nocount+=1
    if k%2==0:
        for i in range(2,k-1,2):
            if S[i-1]!=S[k-1]:
                j=(i+k)//2
                if S[i-1]!=S[j-1] and S[k-1]!=S[j-1]:
                    nocount+=1
print(count-nocount)
### BUGGY CODE ###

N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a = [0]
b = [0]
ans = 0
max_num = 0
j = 0
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
for i in range(N+1):
    if a[i] > K:
        break
    else:
        j = M
        while b[j] > K - a[i]:
            j -=1
            if j <0:
                break
        ans = max(ans,i + j)
print(ans)
        

### FIXED CODE ###

N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
a = [0]
b = [0]
ans = 0
max_num = 0
j = M
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])
for i in range(N+1):
    if a[i] > K:
        break
    else:
        while b[j] > K - a[i]:
            j -=1
            if j <0:
                break
    if K>= a[i] + b[j]:
        ans = max(ans,i + j)
print(ans)