Harryxun/stf_run huggingface dataset:
_input = [i for i in open(0).read().split('\n') if i]
n, k = [int(i) for i in _input[0].split()]
edge = [[int(p) for p in i.split()] for i in _input[1:n]]

if not edge:
    print(k)
else:
    import collections
    import math

    all_edge_map = collections.defaultdict(list)
    for e in edge:
        all_edge_map[e[0]].append(e[1])
        all_edge_map[e[1]].append(e[0])

    root = edge[0]
    visit  = list(all_edge_map[root[0]])
    tree_edge_map = collections.defaultdict(list)
    colored = []
    total = (math.factorial(k) // math.factorial(k - len(all_edge_map[root[0]]) - 1))
    total %= 1000000007
    colored.append(root[0])
    colored.extend(all_edge_map[root[0]])
    while visit:
        current = visit.pop(0)
        candidate = [v for v in all_edge_map[current] if v not in colored]
        if candidate:
            total *= (math.factorial(k - 2) // math.factorial(k - 2 - len(candidate)))
            total %= 1000000007
            colored.extend(candidate)
            visit.extend(candidate)

    print(total)


### FIXED CODE ###

import sys
sys.setrecursionlimit(4100000)

_input = [i for i in open(0).read().split('\n') if i]
n, k = [int(i) for i in _input[0].split()]
edge = tuple([tuple([int(p) for p in i.split()]) for i in _input[1:n]])

factorial = [0] * (k + 1)
inverse = [0] * (k + 1)
MOD = 1000000007

# Ref: http://keita-matsushita.hatenablog.com/entry/2016/12/05/175024
def mod_pow1(n, k, mod):
    a = 1
    while k:
        if (k & 1) == 1:
            a = (a * n) % mod
        n = (n * n) % mod
        k >>= 1
    return a

# Ref: https://www.smartbowwow.com/2018/10/mod1097.html
def mod_pow2(n, k, mod):
    if k == 0:
        return 1
    if k % 2 == 0:
        a = mod_pow2(n, k // 2, mod)
        return (a * a) % mod
    else:
        return (n * mod_pow2(n, k - 1, mod)) % mod

#mod_pow = mod_pow1
# It's better to use built-in function for speed.
mod_pow = pow

def mod_factorial_inverse(k, mod):
    factorial[0] = 1
    inverse[0] = 1

    # Ref: http://keita-matsushita.hatenablog.com/entry/2016/12/05/184011
    for i in range(1, k + 1):
        factorial[i] = ((i * factorial[i - 1]) % mod) # factrial[i]
        inverse[i] = mod_pow(factorial[i], mod - 2, mod) # inverse[i]
 
total = 1

if not edge:
    print(k)
else:
    all_edge = tuple([[] for _ in range(n + 1)])
    for e in edge:
        all_edge[e[0]].append(e[1])
        all_edge[e[1]].append(e[0])
    all_edge = [set(v) for v in all_edge]

    if [v for v in all_edge if len(v) >= k]:
        print(0)
    else:
        mod_factorial_inverse(k, MOD)

        root = edge[0]
        total = (factorial[k] * inverse[k - len(all_edge[root[0]]) - 1]) % MOD

        def dfs(current, from_):
            global total
            child = all_edge[current]
            if len(child) - 1 > 0:
                total = (total * factorial[k - 2] * inverse[k - 2 - (len(child) - 1)]) % MOD
            for c in child:
                if c != from_:
                    dfs(c, current)
        for c in all_edge[root[0]]:
            dfs(c, root[0])
        print(total)
n,k = map(int,input().split())
s = input()
print(str.lower(s[k]))

### FIXED CODE ###

n,k = map(int,input().split())
s = input()
komoji = str.lower(s[k-1])
if k-1 != 0 and k-1 != n-1:
    sum = s[0:k-1] +komoji+s[k:]
elif k-1 == 0:
    sum = komoji + s[k:]
else:
    sum = s[0:k-1] + komoji
print(sum)
I = input()
I = I.split(" ")
N = I[0]
K = I[1]
Q = I[2]

A = [0]*Q

for i in range(Q):
	A[i] = int(input())

point = [0]*N

for i in range(Q):
	point[A[i]] = point[A[i]] + 1

for i in range(Q):
	if point[i] > 0:
		print("yes")
	else:
		print("no")

### FIXED CODE ###

I = input()
I = I.split(" ")
N = int(I[0])
K = int(I[1])
Q = int(I[2])

A = [0] * Q

for i in range(Q):
	A[i] = int(input())

point = [0] * N

for i in range(Q):
	point[A[i]-1] = point[A[i]-1] + 1

for i in range(N):
	if Q - point[i] < K:
		print("Yes")
	else:
		print("No")
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(0,n,2):
if a[i] % 2 == 1:
ans += 1
print(ans)

### FIXED CODE ###


def main():
    
    n = int(input())
    
    Numbers = list(map(int,input().split()))
    count = 0
    for item in range(1,n+1):
        if item % 2 != 0 and Numbers[item-1] % 2 != 0:
            count += 1
    
    print(count)
        
    
  

if __name__ == "__main__":
    main()
def main():
    import sys
    sys.setrecursionlimit(1000000)
    input = sys.stdin.readline

    N = int(input())
    A = [[0]*(N)]
    for _ in range(N):
        A.append([0]+list(map(int,input().split())))

    #選手iにとって、選手jが何番目の相手かを逆引きするメモを用意しておく。
    reverseMemo = {i:{} for i in range(1,N+1)}
    for i in range(1,N+1):
        for j in range(1,N):
            a = A[i][j]
            reverseMemo[i][a] = j

    dp = [[0]+[None]*N for _ in range(N+1)]

    def f(i,j,cnt):
        #iとjの試合が最速でいつできるかを返す。
        if cnt > N*N:
            print(-1)
            exit()
        if dp[i][j] == None and dp[j][i] == None:
            #iの一つ前の試合がいつおわるかを調べる。
            pre = A[i][reverseMemo[i][j]-1]
            tmp1 = f(i,pre,cnt+1)
            
            #jの一つ前の試合がいつおわるかを調べる。
            pre = A[j][reverseMemo[j][i]-1]
            tmp2 = f(j,pre,cnt+1)

            dp[i][j] = max(tmp1,tmp2)+1

        elif dp[i][j] == None and dp[j][i] != None:
            dp[i][j] = dp[j][i]
        elif dp[i][j] != None and dp[j][i] != None:
            dp[j][i] = dp[i][j]
        return dp[i][j]

    ans = 0
    for i in range(1,N+1):
        for j in range(1,N):
            a = A[i][j]
            ans = max(ans,f(i,a,0))
    print(ans)
main()

### FIXED CODE ###

"""
最長経路問題として解く。

各試合のノードを作成。
各試合ノードごとに、「この試合が終わったら、次はこの試合ができるようになる。」という対応関係を作っていく。
"""
def main():
    import sys
    sys.setrecursionlimit(1000000)
    input = sys.stdin.readline

    N = int(input())

    A = [[0]*(N)]
    for i in range(N):
        A.append([0]+list(map(int,input().split())))
    
    #選手iにとって、選手jが何番目の相手かを逆引きするメモを用意しておく。
    reverseMemo = [[-1]*(N+1) for _ in range(N+1)]
    for i in range(1,N+1):
        for j in range(1,N):
            a = A[i][j]
            reverseMemo[i][a] = j
    edges = {}
    for i in range(1,N+1):
        for j in range(i+1,N+1):
            match = (i,j)
            edges[match] = []
            if reverseMemo[i][j] != N-1:
                nx = A[i][reverseMemo[i][j]+1]
                edges[match].append((min(i,nx),max(i,nx)))
            if reverseMemo[j][i] != N-1:
                nx = A[j][reverseMemo[j][i]+1]
                edges[match].append((min(j,nx),max(j,nx)))
    
    del reverseMemo
    del A
    
    stepMemo = {}
    def dfs(i,j,path):
        #i,jの試合日を含めて、あと何日必要なのかを返す。
        if (i,j) not in stepMemo:
            if (i,j) in path:
                print(-1)
                exit()
            else:
                path.add((i,j))
            res = 1
            for a,b in edges[(i,j)]:
                res = max(res,dfs(a,b,path)+1)
            stepMemo[(i,j)] = res
        return stepMemo[(i,j)]

    ans = 0
    for i in range(1,N+1):
        for j in range(i+1,N+1):
            if (i,j) not in stepMemo:
                ans = max(ans,dfs(i,j,set()))
    print(ans)
main()
import sys
input = sys.stdin.readline
def inpl(): return list(map(int, input().split()))

H, W = inpl()
A = [inpl() for _ in range(H)]
B = [inpl() for _ in range(W)]

DP = [[0 for _ in range(W+1)] for _ in range(H+1)]
DP[0][0] = 1 << 12800

for h in range(H):
    for w in range(W):
        d = abs(A[h][w] - B[h][w])
        DP[h+1][w] |= DP[h][w] >> d
        DP[h+1][w] |= DP[h][w] << d
        DP[h][w+1] |= DP[h][w] >> d
        DP[h][w+1] |= DP[h][w] << d
l = 1 << 12800
r = 1 << 12800
for i in range(12801):
    if (DP[-1][-2]& l) | (DP[-1][-2] & r):
        print(i)
        break
    l = l << 1
    r = r >> 1

### FIXED CODE ###

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

H, W = inpl()
A = [inpl() for _ in range(H)]
B = [inpl() for _ in range(H)]

DP = [[0 for _ in range(W+1)] for _ in range(H+1)]
DP[0][0] = 1 << 12800

for h in range(H):
    for w in range(W):
        d = abs(A[h][w] - B[h][w])
        DP[h+1][w] |= DP[h][w] >> d
        DP[h+1][w] |= DP[h][w] << d
        DP[h][w+1] |= DP[h][w] >> d
        DP[h][w+1] |= DP[h][w] << d
l = 1 << 12800
r = 1 << 12800
for i in range(12801):
    if (DP[-1][-2]& l) | (DP[-1][-2] & r):
        print(i)
        break
    l = l << 1
    r = r >> 1
a, b, c = map(int, input().split())
p = 0
for i in range(x):
  if (b + c) * i + c <= a:
    p = i
  else:
    break
print(p)

### FIXED CODE ###

a, b, c = map(int, input().split())
p = 0
for i in range(a):
  if (b + c) * i + c <= a:
    p = i
  else:
    break
print(p)
n=int(input())
import math
res=0
for a in range(1,n+1):
    for b in range(1, n + 1):
        gcd1 = math.gcd(a, b)
        for c in range(1, n + 1):
           gcd2=math.gcd(gcd1,c)
           res+=gcd2
print(res)

### FIXED CODE ###

n=int(input())
import math
res=0
for a in range(1,n+1):
    for b in range(1, n + 1):
        gcd1 = math.gcd(a, b)
        for c in range(1, n + 1):
           gcd2=math.gcd(gcd1,c)
           res+=gcd2
print(res)
a, b = input().split()

print ( str(a)*b if a >= b else str(b)*a) 

### FIXED CODE ###

a, b = input().split()

print ( a*int(b) if int(a) <= int(b) else b*int(a))
import sys
sys.setrecursionlimit(10 ** 7)

n,q = map(int,input().split())
ab = [list(map(int,input().split()))for _ in range(n-1)]
px = [list(map(int,input().split()))for _ in range(q)]

graph = [[] for _ in range(n+3)]
for a,b in ab:
    graph[a].append(b)
    graph[b].append(a)

value = [0]*(n+1)
for p,x in px:
    value[p] += x

def dfs(v,add):
    value[v] += add
    for x in graph[v]:
        dfs(x,value[v])

dfs(1,0)
print(*value[1:],end="\t")


### FIXED CODE ###

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

# 遅延評価で加えてあげるだけ

N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

value = [0] * (N+1)
for p,x in PX:
    value[p] += x

def dfs(v,parent,add):
    value[v] += add
    for x in graph[v]:
        if x == parent:
            continue
        dfs(x,v,value[v])

dfs(1,0,0)

answer = ' '.join(map(str,value[1:]))
print(answer)
x = input()
x = x.split()
s = x[1] * x[2]
l = s * (x[1] + x[2])
print(s, l)

### FIXED CODE ###

x = input().split(" ")
a = int(x[0])
b = int(x[1])
s = a*b
l = 2*(a+b)
print(s, l)
def gcd(x, y):
	if y == 0:
		return x
	else:
		return gcd(y, x % y)

N = int(input())
A = list(map(int, input().split()))
#N = 7
#A = [994, 518, 941, 851, 647, 2, 581]
t = A[0]
for i in range(1,N):
	t = t * A[i] / gcd(t, A[i])
sum = 0
t -= 1
for i in range(N):
	sum += t % A[i]
print(int(sum))


### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
print(sum(A)-N)
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
B = [0 for _ in range(N+1)]
for a in A:
  B[a] = 1

dp = [-1 for _ in range(N+1)]
dp[0] = 1
dp[1] = 1
for i in range(2, N+1):
  if B[i-2] == 0 and B[i-1] == 1:
    dp[i] = dp[i-2]
  elif B[i-2] == 1 and B[i-1] == 0:
    dp[i] = dp[i-1]
  elif:
    dp[i] = dp[i-1] + dp[i-2]
  else:
    dp[i] = 0

print(dp[-1])


### FIXED CODE ###

N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
B = [0 for _ in range(N+1)]
for a in A:
  B[a] = 1
mod = 10**9 + 7
dp = [-1 for _ in range(N+1)]
dp[0] = 1
dp[1] = 1
for i in range(2, N+1):
  if B[i-2] == 0 and B[i-1] == 1:
    dp[i] = dp[i-2]
  elif B[i-2] == 1 and B[i-1] == 0:
    dp[i] = dp[i-1]
  elif B[i-2] == 0 and B[i-1] == 0:
    dp[i] = dp[i-1] + dp[i-2]
  else:
    dp[i] = 0
  dp[i] %= mod
 
print(dp[-1])
import sys
# from math import sqrt, gcd, ceil, log
from bisect import bisect
from collections import defaultdict, Counter
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))

# sys.setrecursionlimit(10**6)

# def func(arr, b):
# 	return([i-b for i in arr])

# def f(i, j, t):
# 	if t >=k:
# 		return(i+j)
# 	return(max(f(i+1, j, t+a_[i+1]), f(i, j+1, t+b_[j+1])))



def solve():
	a, b, k = read(); a_ = read(); b_ = read()
	dic = {}
	def f(i, j, t):
		# print(i, j, t, "******")
		key = (i, j, t)
		if key in dic:
			return(dic[key])
		if t == k:
			# print(i, j, t, "11111")
			dic[key] = i+j
			return(dic[key])
		if t > k:
			# print(i, j, t, "22222")
			dic[key] = i+j-1
			return(dic[key])
		if i ==a and j ==b:
			# print(i, j, t, "0"*5)
			dic[key] = i+j
			return(dic[key])
		if i == a:
			dic[key] = f(i, j+1, t + b_[j])
			return(dic[key])
		if j == b:
			dic[key] = f(i+1, j, t + a_[i])
			return(dic[key])
		

		x = f(i+1, j, t+a_[i]) if i < a else 0#f(i+1, j, t)
		y = f(i, j+1, t+b_[j]) if j < b else 0#f(i, j+1, t)
		dic[key] = max(x, y)
		return(dic[key])
	# for i in range(1, a): a_[i] += a_[i-1]
	# for i in range(1, b): b_[i] += b_[i-1]
	# ans = 0
	# while k > 0:
	# 	inda = bisect(a_, k); indb = bisect(b_, k)
	# 	# print(k, inda, indb, a_[inda-1], b_[indb-1])
	# 	if inda > indb:
	# 		k -= a_[inda-1];
	# 		ans += inda
	# 		a_ = func(a_[inda:], a_[inda-1])
	# 	elif inda == indb:
	# 		if a_[inda-1] < b_[indb-1]:
	# 			k -= a_[inda-1];
	# 			ans += inda
	# 			a_ = func(a_[inda:], a_[inda-1])
	# 		else:
	# 			k -= b_[indb-1];
	# 			ans += indb
	# 			b_ = func(b_[indb:], b_[indb-1])
	# 	else:
	# 		k -= b_[indb-1];
	# 		ans += indb
	# 		b_ = func(b_[indb:], b_[indb-1])
	ans = f(0, 0, 0)
	print(ans)





		

if __name__ == "__main__":
	solve()

### FIXED CODE ###

import sys
# from math import sqrt, gcd, ceil, log
from bisect import bisect
from collections import defaultdict, Counter
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))

# sys.setrecursionlimit(10**6)



def solve():
	n, m, k = read()
	arr1 = [0]+read(); arr2 = [0]+read()
	for i in range(1, n+1):arr1[i] += arr1[i-1]
	for i in range(1, m+1):arr2[i] += arr2[i-1]

	i = 0; ans = 0
	while i < n+1 and arr1[i] <= k:
		tem = i + bisect(arr2, k-arr1[i])-1
		# print(tem, i, arr1[i], bisect(arr2, k-arr1[i]))
		ans = max(ans, tem)
		i += 1
	print(ans)

	





		

if __name__ == "__main__":
	solve()
N,K=map(int,input().split())
A=[]
C=[]
for i in range(N):
    a,b=map(int,input().split())
    T=[a,b]
    A.append(T)
A.sort()
counter=0
for i in range(N):
     counter+=A[i][1]
     if counter>K:
         counter=i
         break
print(A[counter-1][0])

### FIXED CODE ###

N,K=map(int,input().split())
A=[]
C=[]
for i in range(N):
    a,b=map(int,input().split())
    T=[a,b]
    A.append(T)
A.sort()
counter=0
for i in range(N):
     counter+=A[i][1]
     if counter>=K:
         counter=i
         break   
print(A[counter][0])
N,M=map(int,input().split())
INF=10**18
A=[INF]*N
ans=0
for _ in range(M):
    s,c=map(int,input().split())
    s-=1
    if A[s]==INF:
        A[s]=c
    else:
        if A[s]!=c:
            print(-1)
            exit()
        else:
            continue

if A[0]==0:
    print(-1)
    exit()
elif A[0]==INF:
    A[0]=1

for i in range(1,3):
    if A[i]==INF:
        A[i]=0
A=[str(a) for a in A]
print(''.join(A))

### FIXED CODE ###

N,M=map(int,input().split())
A=[]
if M==0:
    if N==1:
        print(0)
        exit()
    elif N==2:
        print(10)
        exit()
    else:
        print(100)
        exit()
        
else:
    for _ in range (M):
        s,c=map(int,input().split())
        A.append([s,c])

    for i in range(1000):
        i=str(i)
        if len(i)!=N:
            continue
        ans=0
        for X in A:
            x=X[0]
            y=X[1]
            x-=1
            if i[x]!=str(y):
                ans=1
                break
            else:
                continue
        if ans==0:
            print(i)
            exit()
print(-1)
def gcd(a,b):
    if b==0:
        return a
    else:
        return gcd(b,a%b)


n,x=map(int,raw_input().split())
print 3*(n-gcd(n,x))


### FIXED CODE ###

n=int(raw_input())
N=map(int,raw_input().split())
N.sort()
count=0
for i in range(n):
    count+=N[2*i]
print count
import collections as col
from functools import reduce
from operator import add
n = int(input())

v = list(map(int, input().split()))

# if len(set(v)) == 1:
#     print(int(n / 2))
#     exit()

odd = v[1::2]
even = v[0::2]

co = col.Counter(odd)
coli = list(co.values())
ce = col.Counter(even)
celi = list(ce.values())

cov = list(co.keys())
cev = list(ce.keys())

if cov[0] != cev[0]:
    a = reduce(add, coli[1:], 0)
    b = reduce(add, celi[1:], 0)
    print(a + b)
else:
    # a1 = reduce(add, coli[1:], 0)
    # b1 = reduce(add, celi[2:], 0)
    # b1 = celi[0] + b1

    # a2 = reduce(add, coli[2:], 0)
    # b2 = reduce(add, celi[1:], 0)
    # a2 = a2 + coli[0]
    ans1 = n - coli[1] - celi[0]
    ans2 = n - coli[0] - celi[1]

    print(min(ans1, ans2))

### FIXED CODE ###

import collections as col
from functools import reduce
from operator import add
n = int(input())

v = list(map(int, input().split()))

if len(set(v)) == 1:
    print(int(n / 2))
    exit()

odd = v[1::2]
even = v[0::2]

co = col.Counter(odd).most_common()
ce = col.Counter(even).most_common()

if co[0][0] != ce[0][0]:
    print(n - co[0][1] - ce[0][1])
else:
    # a1 = reduce(add, coli[1:], 0)
    # b1 = reduce(add, celi[2:], 0)
    # b1 = celi[0] + b1

    # a2 = reduce(add, coli[2:], 0)
    # b2 = reduce(add, celi[1:], 0)
    # a2 = a2 + coli[0]
    if len(co) <= 1:
        co.append((0, 0))
    if len(ce) <= 1:
        ce.append((0, 0))

    ans1 = n - co[1][1] - ce[0][1]
    ans2 = n - co[0][1] - ce[1][1]

    print(min(ans1, ans2))
from math import gcd
a,b,c,d=map(int,input().split(' '))
r1=b-b%c
if a%c!=0:
	l1=a-a%c+c
else:
	l1=a
r2=b-b%d
if a%d!=0:
	l2=a-a%d+d
else:
	l2=a
lcm=(c*d)//gcd(c,d)
r3=b-b%lcm
if a%lcm!=0:
	l3=a-a%lcm+lcm
else:
	l3=a
nc=(r1-l1+c)//c
nd=(r2-l2+d)//d
nlcm=(r3-l3+lcm)//lcm
divi=nc+nd-nlcm
out=b-a+1
if c>a and c>b and d>a and d>b:
	print(0)
else:
	print(out-divi)




### FIXED CODE ###

from fractions import gcd
a,b,c,d=map(int,input().split(' '))
r1=b-b%c
if a%c!=0:
	l1=a-a%c+c
else:
	l1=a
r2=b-b%d
if a%d!=0:
	l2=a-a%d+d
else:
	l2=a
lcm=(c*d)//gcd(c,d)
r3=b-b%lcm
if a%lcm!=0:
	l3=a-a%lcm+lcm
else:
	l3=a
nc=(r1-l1+c)//c
nd=(r2-l2+d)//d
nlcm=(r3-l3+lcm)//lcm
divi=nc+nd-nlcm
out=b-a+1
if c>a and c>b and d>a and d>b:
	print(0)
else:
	print(out-divi)
n = int(input())
x = input()

c = x.count('1')
cp = c+1
cn = c-1

rp = [0] * n
if cp > 1:
    rp[0] = 1
rn = [0] * n
if cn > 1:
    rn[0] = 1
for i in range(1, n):
    rp[i] = (rp[i-1] * 2) % cp
    rn[i] = (rn[i-1] * 2) % cn

xp = 0
xn = 0
for i in range(n):
    xx = x[i]
    if xx == '1':
        xp = (xp + rp[n-i-1]) % cp
        xn = (xn + rn[n-i-1]) % cn

for i in range(n):
    o = 1
    if x[i] == '1':
        xx = (xn-rn[n-i-1]) % cn
    else:
        xx = (xp+rp[n-i-1]) % cp
    while xx > 0:
        cc = bin(xx)[2:].count('1')
        xx = xx % cc
        o += 1
    print(o)


### FIXED CODE ###

n = int(input())
x = input()

c = x.count('1')
cp = c+1
cn = c-1

rp = [0] * n
if cp > 1:
    rp[0] = 1
rn = [0] * n
if cn > 1:
    rn[0] = 1
for i in range(1, n):
    rp[i] = (rp[i-1] * 2) % cp
    if cn > 0:
        rn[i] = (rn[i-1] * 2) % cn

xp = 0
xn = 0
for i in range(n):
    xx = x[i]
    if xx == '1':
        xp = (xp + rp[n-i-1]) % cp
        if cn > 0:
            xn = (xn + rn[n-i-1]) % cn

for i in range(n):
    o = 1
    if x[i] == '1':
        if cn == 0:
            print(0)
            continue
        xx = (xn-rn[n-i-1]) % cn
    else:
        xx = (xp+rp[n-i-1]) % cp
    while xx > 0:
        cc = bin(xx)[2:].count('1')
        xx = xx % cc
        o += 1
    print(o)
N = int(input())
gacha = set()
for _ in range(N):
  gacha.append(input())
print(len(gacha))

### FIXED CODE ###

N = int(input())
gacha = set()
for _ in range(N):
  gacha.add(input())
print(len(gacha))
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


s = list(input())

if a[0] == a[1] or a[1] == a[2] or a[2] == a[3]:
    print("Bad")
else:
    print("Good")

### FIXED CODE ###

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


a = list(input())

if a[0] == a[1] or a[1] == a[2] or a[2] == a[3]:
    print("Bad")
else:
    print("Good")
A, B = map(int, input().split())

if A =< B*2:
  print(0)
else:
  print(A - B*2)

### FIXED CODE ###

A, B = map(int, input().split())
 
if A <= B*2:
  print(0)
else:
  print(A - B*2)
try:
    s1=(input(''))
    if len(s1)==4:
        check=list((s1))
    assert bool(int(check[0]+check[1])<=12) != bool(int(check[2]+check[3])<=12)
    if int(check[0]+check[1])<=12:
        print("MMYY")
    elif int(check[2]+check[3])<=12:
        print("YYMM")
except AssertionError:
    if int(check[0]+check[1])<=12 and int(check[2]+check[3])<=12:
        print("AMBIGUOUS")
    else:
        print("NA")

### FIXED CODE ###

n,k=map(int, input("").split(' '))
assert n>=k>=1
assert 1<=n<=50

s=input('')
assert ("a","b","c" in s)

z=list((s))
z[k-1]=z[k-1].swapcase()

for i in z:
    print(i, end='')
import math

A = int(input())
B = int(input())

x = ((B-1) / (A-1))+1
print(math.ceil(x))


### FIXED CODE ###


s = input()
t = input()

list(s)
list(t)

if s[0] == t[0] and s[1] == t[1] and s[2] == t[2]:
    print(3)

elif s[0] == t[0] and s[1] == t[1] and s[2] != t[2]:
    print(2)

elif s[0] == t[0] and s[1] != t[1] and s[2] == t[2]:
    print(2)

elif s[0] != t[0] and s[1] == t[1] and s[2] == t[2]:
    print(2)

elif s[0] == t[0] and s[1] != t[1] and s[2] != t[2]:
    print(1)

elif s[0] != t[0] and s[1] != t[1] and s[2] == t[2]:
    print(1)

elif s[0] != t[0] and s[1] == t[1] and s[2] != t[2]:
    print(1)

else:
    print(0)
n = int(input())
s = str(input())
count = 0
for i in range(n):
    if s[i] == 'a' or s[i] == 'A':
        if s[i + 1] == 'b' or s[i + 1] == 'B':
            if s[i + 2] == 'c' or s[i + 2] ==  'C':
                count += 1
print(count)

### FIXED CODE ###

n = int(input())
s = str(input())
count = 0
for i in range(n):
    if s[i] == 'a' or s[i] == 'A':
        if i + 1 < n:
            if s[i + 1] == 'b' or s[i + 1] == 'B':
                if i + 2 < n:
                    if s[i + 2] == 'c' or s[i + 2] ==  'C':
                        count += 1
print(count)
N, M = map(int, input().split())
A = list(map(int, input().split()))

s = sum(A[i] >= 1 / (4 * M) for i in N)

if s >= M:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
sumA = sum(A[i] for i in range(N))

s = sum(A[i] / sumA >= 1 / (4 * M) for i in range(N))

if s >= M:
  print('Yes')
else:
  print('No')