Harryxun/stf_run huggingface dataset:
from sys import stdin, stdout
def knapsack(weights,values,capacity,n,memo):
    if(memo[n][capacity]!=-1):
        return memo[n][capacity]
    if(n==0 or capacity==0):
        return 0
    val=0
    left=values[n-1]+knapsack(weights,values,capacity-weights[n-1],n-1,memo)
    right=knapsack(weights,values,capacity,n-1,memo)
    if(weights[n-1]<=capacity):
        temp=max(left,right)
        memo[n][capacity]=temp
        return temp
    memo[n][capacity]=right
    return right

n,capacity=map(int,stdin.readline().split())
weights=[0]*n
values=[0]*n
for i in range(n):
    weights[i],values[i]=map(int,stdin.readline().split())
memo=[[-1]*(capacity+1) for i in range(n+1)]
stdout.write(str(knapsack(weights,values,capacity,n,memo)))

### FIXED CODE ###

# from sys import stdin, stdout
n,capacity=map(int,input().split())
weights=[0]*n
values=[0]*n
for i in range(n):
    weights[i],values[i]=map(int,input().split())
dp=[[0]*(capacity+1) for i in range(n+1)]
for i in range(1,n+1):
    for j in range(1,capacity+1):
        if(weights[i-1]<=j):
            dp[i][j]=max(values[i-1]+dp[i-1][j-weights[i-1]],dp[i-1][j])
        else:
            dp[i][j]=dp[i-1][j]
print(dp[n][capacity])
n = int(input())
t,a = map(int,input().split())
li = list(map(int,input().split()))
nearest = 0
for i in li:
    if abs(nearest - a) > abs((t - i * 0.006) - a):
        nearest = i
print(li.index(nearest))

### FIXED CODE ###

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
dif = 1000
for i in range(N):
    Tx = T - H[i] * 0.006
    if  abs(Tx - A) < dif:
        dif = abs(Tx - A)
        ans = i + 1
print(ans)
N, K = map(int,input().split())
AB = sorted([[list(map(int,input().split())) for _ in range(N)]])

tmp = 0
for a, b in AB:
  if(tmp < K-b):
    tmp += b
  else:
    print(a)
    break

### FIXED CODE ###

N, K = map(int,input().split())
A = sorted([list(map(int,input().split())) for _ in range(N)])

cnt = 0
for a in A:
  if(cnt < K-a[1]):
    cnt += a[1]
  else:
    print(a[0])
    break
"""
unk buriburi
"""
n = int(input())
list = [int(input()) for num in range(n) ]
m = min(list)
a = 0
while True:
    m = m / 2
    if m <= 1:
        break
    a = a + 1
print(a)

### FIXED CODE ###

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

def count(A, n):
    for i in range(n):
        if (A[i] % 2 == 1) or (A[i] == 0):
            return False
        A[i] = A[i] // 2
    return True

while True:
    if count(A, n):
        s += 1
    else:
        break
    
print(s)
N=gets.to_i
ans = 0
sq = (N**(0.5)).to_i
(sq..sq+10).each do |i|
    ans = i*i if i*i <= N
end
puts ans


### FIXED CODE ###

N = int(input())
print(int(N**0.5)**2)
s=input()

if s > 0:
    print(1)
else:
    print(0)

### FIXED CODE ###

s=int(input())

if 0 == s:
    print(1)
else:
    print(0)
from math import math.floor
a = int(input())
b = float(input())
Z = a*b
print(math.floor(Z))


### FIXED CODE ###

import decimal
Deci = decimal.Decimal

a, b = input().split()
x, y = Deci(a), Deci(b)
ans = int(x * y)
print(ans)
S=int(input())
import math

def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)

possibles=0
biggest_sub=S//3
for i in range(1,biggest_sub+1):
	left=S-3*i
	possibles+=nCr(left+i-1,i-1)
n=10**9+7
print(possibles%n)

### FIXED CODE ###

#import sys
#input = sys.stdin.readline
Q = 10**9+7
def cmb(n,r):
    if n-r < r: r = n-r
    if r == 0: return 1
    denominator = 1                       #分母
    numerator = 1                         #分子
    for i in range(r):
        numerator *= n-i
        numerator %= Q
        denominator *= i+1
        denominator %= Q
    return numerator*pow(denominator, Q-2, Q)%Q
 
def main():
    S = int( input())
    ans = 0
    for i in range(1, S//3+1):
        t = S - i*3
        ans += cmb(t+i-1,i-1)
        ans %= Q
    print(ans)
        
if __name__ == '__main__':
    main()
S = input()
Q = int(input())
I = 0
for i in range(Q):
    Query = input().split()
    if Query[0] == 1:
        I = I + 1
    else:
        if (int(Query[1]) + I) % 2 == 0:
            S = S + Query[2]
        else:
            S = Query[2] + S
if I % 2:
    S = S[::-1]
print(S)


### FIXED CODE ###

S = input()
Q = int(input())
I = 0
L = ''
R = ''
for i in range(Q):
    Query = input().split()
    if Query[0] == "1":
        I = I + 1
    else:
        if (int(Query[1]) + I) % 2 == 0:
            R = R + Query[2]
        else:
            L = L + Query[2]
L = L[::-1]
S = L + S + R

if I % 2:
    S = S[::-1]
print(S)
N=int(input())
INF=10**20

X=[]
for i in range(N):
  x,l=map(int,input().split())
  X.append((x-l,x+l-1))
  
X = sorted(X)
rmax=-INF
res=[]
for i in range(N):
  cnt=0
  if rmax>=X[i][0]:
    cnt+=1
  if i<N-1 and X[i][1]>=X[i+1][0]:
    cnt+=1
  res.append(cnt)
  rmax = max(rmax,X[i][1])
  
dellist=[]
for i in range(len(res)):
  if res[i]==2:
    dellist.append(i)

for i in range(len(dellist)):
  del X[dellist[i]]
  
rmax=-INF
res=[]
N=len(X)
for i in range(N):
  cnt=0
  if rmax>=X[i][0]:
    cnt+=1
  if i<N-1 and X[i][1]>=X[i+1][0]:
    cnt+=1
  res.append(cnt)
  rmax = max(rmax,X[i][1])
  
dellist=[]
flag=0
for i in range(len(res)-1):
  if flag==0 and res[i]==res[i+1]==1:
    dellist.append(i)
    flag=1
  if flag:
    flag=0

for i in range(len(dellist)):
  del X[dellist[i]]
  
print(len(X))

### FIXED CODE ###

N=int(input())
INF=10**20
 
X=[]
for i in range(N):
  x,l=map(int,input().split())
  X.append((x-l,x+l-1))
  
X = sorted(X,key=lambda x:x[1])

last=0
ans=1
for i in range(1,N):
  if X[last][1]<X[i][0]:
    ans += 1
    last=i
  else:
    continue
    
print(ans)
a=0
b=0
a=int(input())
b=int(input())
print(a*b,2*(a+b))

### FIXED CODE ###

ab = input()
num_ab = ab.split()
a = int(num_ab[0])
b = int(num_ab[1])
print(a*b,2*(a+b))
n,m = list(map(int, input().split()))
x = []
ans = [0]*m
answ = 0
s,c = [], []

def has_duplicates(seq):
    return len(seq) != len(set(seq))

for i in range(m):
  x.append(list(map(int,input().split())))
  
#重複を取り除く
x = list(map(list, set(map(tuple, x))))

for i,j in x:
  s.append(i)
  c.append(j)
  
#sに重複があれば－１を出力
if m == 0:
  print(-1)
elif has_duplicates(s):
  print(-1)
else:
  for i,j in x:
    ans[i-1] = j
    
  for i in range(len(ans)):
    answ += ans[i]*(10**(m-1-i))

  if ans[0] == 0:
    print(-1)
  else:
    print(answ)
  
  

### FIXED CODE ###

n,m = list(map(int, input().split()))
x = []
ans = [0]*n
answ = 0
s,c = [], []

def has_duplicates(seq):
    return len(seq) != len(set(seq))

for i in range(m):
  x.append(list(map(int,input().split())))
  
#重複を取り除く
x = list(map(list, set(map(tuple, x))))

for i,j in x:
  s.append(i)
  c.append(j)

if (n == 1) and (m == 0):
  print(0)
elif m == 0:
  ans[0] = 1
  for i in range(len(ans)):
    answ += ans[i]*(10**(n-1-i))
    
  print(answ)
elif has_duplicates(s):
  print(-1)
elif (n == 1) and (c.count(0) == 1):
  print(0)
else:
  for i,j in x:
    ans[i-1] = j
    
  if (ans[0] == 0) and (s.count(1) == 0):
    ans[0] = 1
    
  for i in range(len(ans)):
    answ += ans[i]*(10**(n-1-i))

  if ans[0] == 0:
    print(-1)
  else:
    print(answ)
import sys
sys.setrecursionlimit(10**8)
n, m = map(int, input().split())
g = [[] for i in range(n)]
for  i in range(n):
    a, b = map(int, input().split())
    a-=1; b-=1
    g[a].append(b)
    g[b].append(a)

used = [False] * n
ans = 0
def dfs(itr, n, cnt=0):
    if len(itr)==n:
        return 1
    else:
        ans = cnt
        for e in g[itr[-1]]:
            if used[e]:
                continue
            used[e] = True
            ans+=dfs(itr+[e], n)
            used[e] = False
        return ans

used[0] = True
print(dfs([0], n, 0))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
n, m = map(int, input().split())
g = [[] for i in range(n)]
for  i in range(m):
    a, b = map(int, input().split())
    a-=1; b-=1
    g[a].append(b)
    g[b].append(a)

used = [False] * n
ans = 0
def dfs(itr, n, cnt=0):
    ans = 0
    if len(itr)==n:
        return 1
    else:
        ans = cnt
        for e in g[itr[-1]]:
            if used[e]:
                continue
            used[e] = True
            ans+=dfs(itr+[e], n)
            used[e] = False
    return ans

used[0] = True
print(dfs([0], n, 0))
length = int(input())
string = input()
count=0

for i in range(0,length):
    if ("A" == string[i]) and ("B" == string[i+1]) and ("C" == string[i+2]) and i>length-2:
        count+=1
        i+=3

print(count)

### FIXED CODE ###

length = int(input())
string = input()
print(string.count("ABC"))
import itertools
n=int(input())
A=[0 for i in range(n)]
A=input().split()
for i in range(n):
    A[i]=int(A[i])
q=int(input())
B=[0 for i in range(q)]
B=input().split()
C=[]
for i in range(q):
    B[i]=int(B[i])
l=[0,1]
p=[]
k=0
D=[]
for v in itertools.product(l,repeat=n):
    sum=0
    for i in range(n):
        if v[i]==1:
            sum=sum+A[i]
    D.append(sum)
    k+=1
for i in range(q):
    c=0
    for j in range(k):
        if B[i]==D[j] and c==0:
            C.append("yes")
            c+=1
    if c==0:
        C.append("no")
for i in range(q):
    print(C[i])




### FIXED CODE ###

import itertools
n=int(input())
A=[0 for i in range(n)]
A=input().split()
for i in range(n):
    A[i]=int(A[i])
q=int(input())
B=[0 for i in range(q)]
B=input().split()
C=[]
for i in range(q):
    B[i]=int(B[i])
l=[0,1]
p=[]
k=0
D=[]
for v in itertools.product(l,repeat=n):
    sum=0
    for i in range(n):
        if v[i]==1:
            sum=sum+A[i]
    D.append(sum)
    k+=1
for i in range(q):
    if B[i] in D:
        C.append("yes")
    else:
        C.append("no")
for i in range(q):
    print(C[i])
import sys
input = sys.stdin.readline
import numpy as np
x, y, a, b, c = map(int, input().split())
P = [0]*x + [int(p) for p in input().split()]
Q = [0]*y + [int(q) for q in input().split()]
R = [int(r) for r in input().split()]

P.sort()
Q.sort()
R.sort(reverse=True)
Px = P[a:]
Qy = Q[b:]
R = R[:x+y]
pc, qc = 0, 0
pqpq = [Px, Qy]
pqc = [pc, qc]
for r in R:
    if Px[pqc[0]]<Qy[pqc[1]]:
        pq = 0
    else:
        pq = 1
    if pqpq[pq][pqc[pq]] < r:
        pqpq[pq][pqc[pq]] = r
        pqc[pq]+= 1
    else:
        break

print(sum(Px)+sum(Qy))


### FIXED CODE ###

import sys
input = sys.stdin.readline
import numpy as np
x, y, a, b, c = map(int, input().split())
P = [0]*x + [int(p) for p in input().split()]
Q = [0]*y + [int(q) for q in input().split()]
R = [int(r) for r in input().split()]

P.sort()
Q.sort()
R.sort(reverse=True)
Px = P[a:]
Qy = Q[b:]
R = R[:x+y]
pc, qc = 0, 0
pqpq = [Px, Qy]
pqc = [pc, qc]
pqctop=[x, y]
for r in R:
    if pqc[0] == x:
        pq = 1
    elif pqc[1] == y:
        pq = 0
    else:
        if Px[pqc[0]]<Qy[pqc[1]]:
            pq = 0
        else:
            pq = 1
    if pqpq[pq][pqc[pq]] < r:
        pqpq[pq][pqc[pq]] = r
        pqc[pq]+= 1
    else:
        break

print(sum(Px)+sum(Qy))
import sys
input = sys.stdin.readline

def main():
    N, Q = map(int, input().split())
    edges = [[] for _ in range(N)]
    edges[0].append(0)
    for _ in range(N-1):
        a, b = map(int, input().split())
        edges[b-1].append(a-1)

    counts = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        counts[p-1] += x

    print(counts[0], end=' ')
    for i in range(1, N):
        counts[i] += counts[edges[i][0]]
        print(counts[i], end=' ')

if __name__ == "__main__":
    main()

### FIXED CODE ###

from collections import deque
import sys
input = sys.stdin.readline

def main():
    N, Q = map(int, input().split())
    # edges = [None]*N
    edges = [[] for _ in range(N)]
    # edges[0] = 0
    # edges[0].append = 0
    for _ in range(N-1):
        a, b = map(int, input().split())
        edges[b-1].append(a-1)
        edges[a-1].append(b-1)

    counts = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        counts[p-1] += x

    parent_nodes = deque()
    parent_nodes.append(0)
    visited_nodes = set()
    while parent_nodes:
        parent = parent_nodes.popleft()
        if parent in visited_nodes:
            continue
        visited_nodes.add(parent)
        for child in edges[parent]:
            if child in visited_nodes:
                continue
            counts[child] += counts[parent]
            parent_nodes.append(child)

    print(' '.join(list(map(str, counts))))

if __name__ == "__main__":
    main()
N = int(input())
number = []
    for A in range(1,10):
      for B in range(1,10):
        number.append(A*B)
if N in number :
  print("Yes")
else :
  print("No")

### FIXED CODE ###

N = int(input())
number = []
for a in range(1,10):
    for b in range(1,10):
        number.append(b*a)
if N in number :
    print("Yes")
else :
    print("No")
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()

factorial = [1]
for i in range(1, N):
	factorial.append(factorial[i-1] * i % mod)

def power(x, y):
	if y == 0:
		return 1
	elif y == 1:
		return x % mod
	elif y % 2 == 0:
		return power(x, int(y/2)) ** 2 % mod
	else:
		return power(x, int((y-1)/2)) ** 2 * x % mod

def C(n, r):
	return (((factorial[n] * x_inv[r]) % mod) * x_inv[n-r]) % mod

x_inv = [0] * (N)
x_inv[-1] = power(factorial[-1], mod-2)
for i in range(N-2, -1, -1):
	x_inv[i] = x_inv[i+1] * (i+1) % mod

for i in range(1, K+1):
	print((C(K-1, i-1)*C(N-K+1, i))%mod)


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()

factorial = [1]
for i in range(1, N+1):
	factorial.append(factorial[i-1] * i % mod)

def power(x, y):
	if y == 0:
		return 1
	elif y == 1:
		return x % mod
	elif y % 2 == 0:
		return power(x, int(y/2)) ** 2 % mod
	else:
		return power(x, int((y-1)/2)) ** 2 * x % mod

def C(n, r):
	return (((factorial[n] * x_inv[r]) % mod) * x_inv[n-r]) % mod

x_inv = [0] * (N+1)
x_inv[-1] = power(factorial[-1], mod-2)
for i in range(N-1, -1, -1):
	x_inv[i] = x_inv[i+1] * (i+1) % mod

for i in range(1, K+1):
	if N-K >= i-1:
		print((C(K-1, i-1)*C(N-K+1, i))%mod)
	else:
		print(0)
W, H, x, y, r = list(map(int,input.split))
print('YES'if 0 <= x- r <= x + r and 0 <= y-r <= y+r,'NO'else)

### FIXED CODE ###

W, H, x, y, r = list(map(int, input().split()))
print('Yes' if 0 <= x - r <= x + r <= W and 0 <= y - r <= y + r <= H else 'No')
a,b=list(map(int,input().split()))
print([a+b,b-a][b%a])

### FIXED CODE ###

a, b = list(map(int, input().split()))
print([a+b,b-a][b%a!=0])
N,M=map(int,input().split())
L=[]
S=[]
for i in range(N):
    x = input()
    l=[y for y in x]
    L.append(l)
for i in range(M):
    x = input()
    s=[y for y in x]
    S.append(s)
flag = 0
sum = 0
for i in range(N):
    for j in range(N):
        for k in range(M):
            for l in range(M):
                if i+k < N and j+l < N:
                    if L[i+k][j+l] == S[k][l]:
                        sum += 1
                        if sum == M * M:
                            flag = 1
                    else:
                        sum = 0
if flag == 0:
    print("No")
else:
    print("Yes")


### FIXED CODE ###

table=[2,3,4,5,6,7,8,9,10,11,12,13,1]
a,b=map(int,input().split())
if a == b :
    print("Draw")
elif table.index(a) < table.index(b):
    print("Bob")
elif table.index(a) > table.index(b):
    print("Alice")
N = int(input())
S = [input() for i in range(N)]
s = sorted(S)
import collections
c = collections.Counter(s)
C = c.most_common()

a = C[0][1]
b = []
for i in range(N):
  if a == C[i][1]:
    b.append(C[i][0])
  else:
    break
B = sorted(b)

for i in B:
  print(i)

### FIXED CODE ###

N = int(input())
S = [input() for i in range(N)]
s = sorted(S)
import collections
c = collections.Counter(s)
C = c.most_common()
 
a = C[0][1]
b = []
for i in range(len(C)):
  if a == C[i][1]:
    b.append(C[i][0])
  else:
    break
B = sorted(b)
 
for i in B:
  print(i)
#my answer
n, k = map(int,input().split())
li = list(map(int,input().split()))

L = []
R = [0]

for x in li:
    if(x < 0):
        L.append(abs(x))
    elif(x > 0):
        R.append(abs(x))
    else:
        k -= 1
        
x = L + R

l = len(L) - k
if(l < 0):
    l = 0
r = l + k

ans = 99999999;
for i in range(n - k):
    ans = min(ans, x[r]*2 + x[l])
    ans = min(ans, x[l]*2 + x[r])
    r += 1
    l += 1
    
if(k == 1):
    ans = min(x[r], x[r-1])
    
print(ans)

### FIXED CODE ###

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

ans = 999999999

for i in range(n - k + 1):
    a = abs(x[i]) + (x[i + k - 1] - x[i])
    b = abs(x[i + k - 1]) + (x[i + k - 1] - x[i])
    ans = min(ans, a, b)
    
print(ans)
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    s = input().rstrip()
    a = list(set(s))
    if s.count(a[0]) == s.count(a[1]) == 2:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    s = input().rstrip()
    a = list(set(s))
    if len(a) <2:
        print('No')
        exit()
    if s.count(a[0]) == s.count(a[1]) == 2:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()
n = int(input())

print(n - (n+1)%2)//2

### FIXED CODE ###

n = int(input())

print((n - (n+1)%2)//2)
N, X = map(int, input().split())
pat = [1 for _ in range(N)]
mai = [1 for _ in range(N)]
for i in range(1, N+1):
  mai[i] = 2 * mai[i-1] + 3
  pat[i] = 2 * pat[i-1] + 1

def cnt_pat(x, n):
  if n == 0:
    return 1
  if x == 1:
    return 0
  if x <= mai[n] // 2:
    return cnt_pat(x-1, n-1)
  if x == mai[n] // 2 + 1:
    return pat[n-1] + 1
  if x < mai[n]:
    return pat[n-1] + 1 + cnt_pat(x-mai[n]//2-1, n-1)
  if x == n:
    return pat[n]
  
print(cnt_pat(X, N))

### FIXED CODE ###

N, X = map(int, input().split())
pat = [1 for _ in range(N+1)]
mai = [1 for _ in range(N+1)]
for i in range(1, N+1):
  mai[i] = 2 * mai[i-1] + 3
  pat[i] = 2 * pat[i-1] + 1

def cnt_pat(x, n):
  if n == 0:
    return 1
  if x == 1:
    return 0
  if x <= mai[n] // 2:
    return cnt_pat(x-1, n-1)
  if x == mai[n] // 2 + 1:
    return pat[n-1] + 1
  if x < mai[n]:
    return pat[n-1] + 1 + cnt_pat(x-mai[n]//2-1, n-1)
  if x == mai[n]:
    return pat[n]
  
print(cnt_pat(X, N))
n=int(input())
a=list(map(int,input().split()))
Q=[True]*n
a.sort()
t=0
for i in range(n):
    if !Q[j]:
        continue
    b=a[i]
    for j in range(i,n):
        if !Q[j]:
            continue
        if a[j]%b==0:
            Q[j]=False
    t+=1
print(t)

### FIXED CODE ###

n=int(input())
A=list(map(int,input().split()))
A.sort()
t=0
e=[True]*1000001
for i in range(n-1):
    a=A[i]
    if e[a]==False:
        continue
    b=a*2
    while b < 1000001:
        e[b]=False
        b+=a
    if A[i+1]==a:
        e[a]=False
for a in A:
    if e[a]:
        t+=1
print(t)
n = input()
li = list(map(int,input().split())
cnt = 0
print(n)
print(li)

while True:
    for i in range(n):
        if li[i]%2 ==0:
            pass
        else:
            break

    for j in range(n):
        li[j]/=2

    cnt += 1

print(cnt)

### FIXED CODE ###

n = int(input())
li = list(map(int,input().split()))
cnt = 0

while all(i%2==0 for i in li):
  for i in range(n):
    li[i]/=2
  cnt+=1

print(cnt)
S=input()
if S[3] is S[4] and S[5] is S[6]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S=input()
if S[2] is S[3] and S[4] is S[5]:
    print("Yes")
else:
    print("No")
n,k=map(int,input().split())
a=list(map(int,input().split()))
l=-1
r=max(a)+1
while r-l>1:
	cnt=0
	mid=(l+r)//2
	for x in a:
		cnt+=(x-1)//mid
	if cnt<=k:
		r=mid
	else:
		l=mid
print(r)


### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
l=0
r=max(a)+1
while r-l>1:
	cnt=0
	mid=(l+r+1)//2
	if mid==0:
		print(1)
		exit()
	for x in a:
		if x>1:
			cnt+=(x-1)//mid
	if cnt<=k:
		r=mid
	else:
		l=mid
print(r)
N = int(input())
l = []
c = 0

for i in range(1,N+1):
  a = int(input())
  l.append(a)

for j in range(1,N+1):
  for k in range(1,N+1):
    if j == k:
      continue
    for m in range(1,N+1):
      if (j == m) or (k == m):
        continue
      if (l[j] + l[k] > l[m]) or (l[j] + k[m] > l[k]) or (l[k] + l[m] > l[j]):
        c += 1

print(c)

### FIXED CODE ###

N = int(input())
L = list(map(int, input().split()))
c = 0
 
for i in range(N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      if L[i]!=L[j] and L[j]!=L[k] and L[k]!=L[i]:
        if L[i] + L[j] + L[k] > 2 * max(L[i],L[j],L[k]):
          c +=1
 
print(c)
inf = pow(10, 9)+7

def nCr(n, r):
    r = min(r, n - r)
    if r == 0: return 1;
    if r == 1: return n;
    numerator = [n - r + i + 1 for i in range(r)]
    denominator  = [i + 1 for i in range(r)]
    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot
    result = 1
    for k in range(r):
        if numerator[k] > 1: 
            result *= numerator[k]
    return result


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

ans = 0
key = (nCr(n-1, k-1))
for i in range(n-k+1):
    ans += ((a[-i-1] - a[i])%inf)*(key%inf)
    ans %= inf
    if n-i-1 != 0:
	    key = key*(n-k-i)//(n-1-i)
    else:
        break
print(int(ans))

### FIXED CODE ###

inf = pow(10, 9)+7

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

ans = 0
comb = 1
for i in range(k, n+1):
    ans += (a[i-1]-a[-i])*comb
    ans %= inf
    comb = (comb * i * pow(i-k+1, inf-2, inf))%inf
print(ans)
import math

S = input().split()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

E = int((C * D) / math.gcd(C, D))
X = math.floor(B/C) - math.floor(A/C)
Y = math.floor(B/D) - math.floor(A/D)
Z = math.floor(B/E) - math.floor(A/E)

print(int(B-A-X-Y+Z))


### FIXED CODE ###


def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a

 #最小公倍数


def lcm(a, b):
    return a*b//gcd(a, b)


S = input().split()
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])

E = lcm(C, D)

X = int(B//C)-int((A-1)//C)
Y = int(B//D)-int((A-1)//D)
Z = int(B//E)-int((A-1)//E)

print(B-A+1-X-Y+Z)
str = input()
str_list = list(str)

if str_list[0] == str_ list[2]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

str = input()
str_list = list(str)
 
if str_list[0] != str_list[1]:
  print("Yes")
elif str_list[1] != str_list[2]:
  print("Yes")
else:
  print("No")