Harryxun/stf_run huggingface dataset:
import math
def check1(N):
    n = int(math.log10(N))
    return 9*n+(N//(10**n))
def check2(N):
    n = int(math.log10(N))
    return n*(n-1)/2*81+(N//(10**n)-1)*n*9+check1(N%(10**n))
def check3(N):
    n = int(math.log10(N))
    summ = 0
    for i in range(2, n):
        summ += i*(i-1)/2
    return summ*729+(N//(10**n)-1)*n*(n-1)/2*81+check2(N%(10**n))

def main():
    N = int(input())
    K = int(input())
    if K == 1:
        print(int(check1(N)))
    elif K == 2:
        print(int(check2(N)))
    elif K == 3:
        print(int(check3(N)))
        
main()

### FIXED CODE ###

import math
def check1(N):
    if N == 0:
        return 0
    n = int(math.log10(N))
    return 9*n+(N//(10**n))
def check2(N):
    if N == 0:
        return 0
    n = int(math.log10(N))
    return n*(n-1)/2*81+(N//(10**n)-1)*n*9+check1(N%(10**n))
def check3(N):
    if N == 0:
        return 0
    n = int(math.log10(N))
    summ = 0
    if n >= 3:
        for i in range(n):
            summ += i*(i-1)/2
    return summ*729+(N//(10**n)-1)*n*(n-1)/2*81+check2(N%(10**n))
def main():
    N = int(input())
    K = int(input())
    if K == 1:
        print(int(check1(N)))
    elif K == 2:
        print(int(check2(N)))
    elif K == 3:
        print(int(check3(N)))
        
main()
import sys
import os
f = open("input.txt", "r")
sys.stdin = f

n, m = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(m)]

for i in range(m):
    for j in range(m):
        if i != j and lst[i][0] == lst[j][0] and lst[i][1] != lst[j][1]:
            print(-1)
            exit()

ans = "0" * n
for l in lst:
    if l[0] == 1 and l[1] == 0:
        print(-1)
        exit()
    ans = ans[: l[0] - 1] + str(l[1]) + ans[l[0]: ]

if ans[0] == "0":
    ans = "1" + ans[1: ]

print(ans)


### FIXED CODE ###

n, m = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(m)]
ans = -1
for i in range(10 ** n):
    tmp = str(i)
    if len(tmp) == n:
        flg = True
        for l in lst:
            if tmp[l[0] - 1] != str(l[1]):
                flg = False
                break
        if flg == True:
            ans = i
            break
print(ans)
a = map(int, input())

probability = 0.0
if a%2 == 0:
	probability = 0.5
else:
	probability = 1.0/float(a)*(a/2 + 1)
  
print(probability)

### FIXED CODE ###

a = int(input())

probability = 0.0
if a%2 == 0:
	probability = 0.5
else:
	probability = 1.0/float(a)*(int(a/2) + 1)
  
print(probability)
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

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()
V = LIST()
max_ = 0
for j in range(K%2, K+1, 2):
	if j == 0:
		continue
	if j > N:  # N こまでしかとれない
		break
	# print("---j={}---".format(j))
	for i in range(j+1):  # jは残す数
		if (j+K)//2 >= N:
			tmp_lis = V[:]
		else:
			l = -i
			r = (j+K)//2 - i
			if l == 0 or r == -1:
				tmp_lis = V[l:r]
			else:
				tmp_lis = V[0:r] + V[l:]
		tmp_lis.sort(reverse=True)
		# print(tmp_lis)
		tmp = sum(tmp_lis[:j])
		max_ = max(max_, tmp)
		if (j == N or j == N-1) and K > N:  # とれる個数が多いとき
			for i in range(K-N):
				# print(tmp_lis)
				tmp_lis.pop()
				tmp = sum(tmp_lis)
				max_ = max(max_, tmp)
print(max_)


### FIXED CODE ###

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

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()
V = LIST()
R = min(N, K)

max_ = 0
for A in range(R+1):
	for B in range(R+1):
		if A+B > R:
			continue
		if B == 0:
			lis = V[:A]
		else:
			lis = V[:A] +  V[-B:]
		# print(A, B)
		# print(lis)
		lis.sort()
		for i in range(K-(A+B)):
			if lis and lis[0] < 0:
				lis.pop(0)
		tmp = sum(lis)
		max_ = max(max_, tmp)
print(max_)
n=int(input())

alphabet=[None] + [chr(i) for i in range(97,97+26)]

if n<27:
    print(alphabet[n])
    exit()
    
rest=[]
while n!=0:
    rest.append(n%26)
    n = n // 26
rest.reverse()

if rest[-1]==0:
    for i in range(len(rest)-1):
        rest[i]=26
    rest.pop(-1)

ans=''
for i in range(len(rest)):
    ans+=alphabet[rest[i]]
print(ans)


### FIXED CODE ###

n=int(input())

alphabet=[None] + [chr(i) for i in range(97,97+26)]

rest=[]
while n!=0:
    rest.append(n%26)
    n = n // 26
rest.reverse()

for i in range(len(rest)-1):
    if rest[len(rest)-1-i]<=0:
        rest[len(rest)-1-i]+=26
        rest[len(rest)-2-i]-=1
if rest[0]<=0:
    rest=rest[1:]

ans=''
for i in range(len(rest)):
    ans+=alphabet[rest[i]]
print(ans)
A=int(inpur())
B=int(inpur())
print(6-A-B)

### FIXED CODE ###

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

if A == 1 and B== 2:
    print(3)
if A == 1 and B== 3:
    print(2)
if A == 2 and B== 1:
    print(3)
if A == 2 and B== 3:
    print(1)
if A == 3 and B== 1:
    print(2)
if A == 3 and B== 2:
    print(1)
import numpy as np
import copy

N= int(input())
S=input()
SS= copy.copy(S)
S = list(S)
#N, A, B = map(int, input().split())

flag = 1
#print(len(S))
while flag == 1:
    flag = 0
    flag2 = 1
    i = 0
    while flag2:
    # for i in range(len(S)-1):
        #print(i)
        if S[i]=="(" and S[i+1] ==")":
            flag = 1
            del S[i] 
            del S[i+1]
            i -= 2
        i += 1
        i = max(0,i)
        if i>len(S):
            flag2 = 0
a=0
b=0
for i in range(len(S)):
    if S[i]=="(":
        b+=1
    elif S[i]==")":
        a+=1
#print(S)
# initialization of string to ""
A = ""
B = ""

# traverse in the string
for x in range(a):
    
    A += "("   
for x in range(b):    
    B += ")"   

        
#print(str(A)+SS+str(B))
print(A+SS+B)
    


### FIXED CODE ###

import numpy as np
import copy

N= int(input())
S=input()
SS= copy.copy(S)
S = list(S)
#N, A, B = map(int, input().split())

flag = 1
#print(len(S))
while flag == 1:
    flag = 0
    flag2 = 1
    i = 0
    while flag2 and len(S)>1:
    # for i in range(len(S)-1):
        #print(S)
        if S[i]=="(" and S[i+1] ==")":
            # print(S, i)
            flag = 1
            del S[i] 
            del S[i]
            i -= 1
            # print(S, i)
        i += 1
        i = max(0,i)
        if i+1>=len(S):
            flag2 = 0
a=0
b=0
for i in range(len(S)):
    if S[i]=="(":
        b+=1
    elif S[i]==")":
        a+=1
#print(S)
# initialization of string to ""
A = ""
B = ""

# traverse in the string
for x in range(a):
    
    A += "("   
for x in range(b):    
    B += ")"   

        
#print(str(A)+SS+str(B))
print(A+SS+B)
Title = input().split(' ')
answer = ""

for smallTitle in Title:
  answer += smallTitle[0]

return answer

### FIXED CODE ###

Title = input().split(' ')
answer = ""
 
for smallTitle in Title:
  answer += smallTitle[0]

print(answer)
import sys

n,m = map(int,input().split())
s = [] ; c = []
for i in range(m) :
  st,ct = map(int,input().split())
  s.append(st) ; c.append(ct)

if n == 1 :
  ans(c[0])
  sys.exit()

ans = [[0,0] for i in range(n)]  
for i in range(m) :
  if s[i] == 1 and c[i] == 0 :
    print(-1)
    sys.exit()
  if ans[s[i]-1][1] == 0 :
    ans[s[i]-1][0] = c[i] 
    ans[s[i]-1][1] = 1
  else :
    if ans[s[i]-1][0] != c[i] :
      print(-1)
      sys.exit()

if ans[0][0] == 0 :
  ans[0][0] = 1

ansn = 0
for i in range(n) :
  ansn += ans[i][0]*10**(n-1-i)
  
print(ansn)

### FIXED CODE ###

import sys

n,m = map(int,input().split())
s = [] ; c = []
for i in range(m) :
  st,ct = map(int,input().split())
  s.append(st) ; c.append(ct)

ans = [[0,0] for i in range(n)]  
for i in range(m) :
  if s[i] == 1 and c[i] == 0 and n >= 2 :
    print(-1)
    sys.exit()
  if ans[s[i]-1][1] == 0 :
    ans[s[i]-1][0] = c[i] 
    ans[s[i]-1][1] = 1
  else :
    if ans[s[i]-1][0] != c[i] :
      print(-1)
      sys.exit()

if ans[0][0] == 0 and n >= 2 :
  ans[0][0] = 1

ansn = 0
for i in range(n) :
  ansn += ans[i][0]*10**(n-1-i)
  
print(ansn)
n = int(input())
h = list(map(int,input().split(' ')))

dp = {}
myinf = int(1e9 + 5)

def frog1(i):
    if i==n-1:
        return 0
    if i>n-1:
        return myinf
    
    if i in dp:
        return dp[i]
    
    a = frog1(i+1)
    b = frog1(i+2)
    h1 = myinf if i+1>n-1 else h[i+1]
    h2 = myinf if i+2>n-1 else h[i+2]
    
    a = a + abs(h[i]-h1)
    b = b + abs(h[i]-h2)
    dp[i] = min(a,b)
    return dp[i]
print(frog1(0))


### FIXED CODE ###

import math
n = int(input())
h = list(map(int,input().split(' ')))
'''
n-=1
inf = int(1e9+5)

dp = {}
def frog1(i):
    if i==n:
        return 0
    if i in dp:
        return dp[i]
    
    a = 0
    b = 0
    if i+1>n:
        a = inf
    else:
        a = frog1(i+1)+abs(h[i]-h[i+1])

    if i+2>n:
        b = inf
    else:
        b = frog1(i+2)+abs(h[i]-h[i+2])
    dp[i] = min(a,b)
    return dp[i]
'''
def solve(n,h):
    dp = [0]*n
    for i in reversed(range(0,n-1)):
        if i==n-1:
            dp[i] = 0
        else:
            if i==n-2:
                dp[i] = abs(h[n-1]-h[n-2])
                continue
            a = 0
            b = 0
            if i+1<=n-1:
                a = dp[i+1]+abs(h[i]-h[i+1])
            if i+2<=n-1:
                b = dp[i+2]+abs(h[i]-h[i+2])  
            dp[i] = min(a,b)
    return dp[0]
print(solve(n,h))
import numpy as np
a,b = input().split()
numpy.trunc(a+b/2)

### FIXED CODE ###

import numpy as np
a,b = input().split()
print(int(np.ceil((int(a)+int(b))/2)))
n=int(input())
X=[]
Y=[]
A=[0]*n
for i in range(n):
  A[i]=int(input())
  a=A[i]
  x=[]
  y=[]
  for j in range(a):
    x,y=[int(s) for s in input().split()]
  X.append(x)
  Y.append(y)
  
c=0
for i in range(n):
  l=[1]*n
  for j in range(i, n-i):
    if l[j]==0:continue
    for k in range(A[j]):
      b=X[j][k]
      l[b] *= Y[j][k]
#if c<l.count(1):
 # c=l.count(1) 
  
        
  
print(c)  
   

### FIXED CODE ###

n=int(input())
X=[]
Y=[]
A=[0]*n
for i in range(n):
  A[i]=int(input())
  a=A[i]
  x=[0]*a
  y=[0]*a
  for j in range(a):
    x[j],y[j]=[int(s) for s in input().split()]
  X.append(x)
  Y.append(y)
  
s=0
for i in range(2**n):
  c=0
  d=0
  B=[0]*n
  for j in range(n):
    if((i >> j) & 1):
      c=c+1
      B[j]=1
  for k in range(n):
    if B[k]==1:
      for j in range(A[k]):
        if Y[k][j]!=B[X[k][j]-1]:
          d=-1
          break
    if d<0:
      break
  if s<c and d==0:
    s=c
      
      
print(s)
def main():

    N = [0]*int(input())
    A = list(map(int, input().split()))

    for i in A:
        N[i-1]+=1

    for i in N:
        print(i)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import math


def main():

    R = int(input())
    print(R*2*math.pi)


if __name__ == '__main__':
    main()
n = int(input())
s = input()
idx = 0
tmp = s[1]
idx = 1
ans = 1
while(idx<n):
    if s[idx]==tmp:
        idx += 1
    else:
        tmp = s[idx]
        idx += 1
        ans +=1
print(ans)


### FIXED CODE ###

n = int(input())
s = input()
idx = 0
idx = 1
ans = 1
if n == 1:
    print(1)
else:
    tmp = s[0]
    while(idx<n):
        if s[idx]==tmp:
            idx += 1
        else:
            tmp = s[idx]
            idx += 1
            ans +=1
    print(ans)
N = list(input())
    if ("7" in N):
      print("Yes")
    else:
      print("No")


### FIXED CODE ###

N = list(input())
if ("7" in N):
    print("Yes")
else:
    print("No")
D = {"a":0, "b":1, "c":2}
l = ["A", "B", "C"]
 
x = [[D[a] for a in input()] for _ in range(len(l))]
c = 0
while x[c]:
    c = x[c].pop(0)
print(I[c])

### FIXED CODE ###

D = {"a":0, "b":1, "c":2}
l = ["A", "B", "C"]
 
x = [[D[a] for a in input()] for _ in range(len(l))]
c = 0
while x[c]:
    c = x[c].pop(0)
print(l[c])
import sys
from itertools import permutations
from math import factorial

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def distance2(x1, y1, x2, y2):
    return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5


def main():
    N = int(readline())
    C = [tuple(map(int, readline().split())) for _ in range(N)]

    dist = [[0] * N for _ in range(N)]
    for i in range(N):
        for j in range(i + 1, N):
            dist[i][j] = dist[j][i] = distance2(*C[i], *C[j])

    ans = 0
    for perm in permutations(range(N)):
        for i in range(N - 1):
            ans += dist[perm[i]][perm[i + 1]]

    print(ans / factorial(N))
    return


if __name__ == '__main__':
    main()


### FIXED CODE ###

from itertools import permutations
from math import factorial

N = int(input())
cities = [tuple(map(int, input().split())) for _ in range(N)]

dists = [[0] * N for _ in range(N)]
for i in range(N):
    for j in range(i + 1, N):
        dists[i][j] = dists[j][i] = (
            (cities[j][0] - cities[i][0]) ** 2 + (cities[j][1] - cities[i][1]) ** 2
        ) ** 0.5

total_dist = 0
for p in permutations(range(N)):
    for i in range(N - 1):
        total_dist += dists[p[i]][p[i + 1]]

print(total_dist / factorial(N))
N, Y = map(int, input().split())
x = 0
y = 0
z = 0
ans = 0
for i in range(1,N):
    for k in range(1,N):
        z = N - i - k
        if (i*10000 + k*5000 + z*1000 )== Y and:
            x = i
            y = k
            ans = 1
            break
if ans == 1:
    print(x,y,z)
else:
    print( '-1 -1 -1')

### FIXED CODE ###

N,Y=map(int,input().split())
answer=-1,-1,-1
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            answer=x,y,z
            break
    else:
        continue
    break
print(*answer)
n,a,b=map(int, input().split())
count=n//a+b*a
n=n%(a+b)
count+=min(n,a)
print(count)


### FIXED CODE ###

n,a,b=map(int, input().split())
count=n//(a+b)*a
n=n%(a+b)
count+=min(n,a)
print(count)
import numpy as np
from numba import jit
verbose = False

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

ul = np.ceil(np.sum(A)/(K))
ll= np.floor(np.max(A)/(K+1))

EPS = 1 / 10**6

@jit(nopython=True)
def cut(A, c, N):
    return (np.sum(np.ceil(A/c))-N)

c = np.ceil((ul+ll)/2)
mx = np.max(A)
while True:
    if ul-ll == 1:
        break
    nk = cut(A, c, N)
    if verbose:
        print('c:', c, 'nk:', nk, 'ul - ll:', ul, '/', ll)
    prev = c
    if nk  >K: # more cuts than target; larger logs can be made
        ll = c
        c = np.floor(ul + c)/2)
    else: #i.e. nk < K, less cuts than target
        ul = c
        c = np.ceil((c + ll)/2)
        
if cut(A, ll+EPS, N) >= K:
    print(np.min((np.max(A), int(ul))))
else:
    print(int(ll))
    


### FIXED CODE ###

import numpy as np
from numba import jit
import random
verbose = False
rand = False

if rand:
    N, K = random.choice(range(10)), random.choice(range(10))
    A = np.array(random.choices(range(10**9), k=N))
else:
    N, K = list(map(int, input().split()))
    A = np.array(list(map(int, input().split())), dtype=np.int64)

ul = np.ceil(np.sum(A)/(K+1))
ll= np.floor(np.max(A)/(K+1))

EPS = 1 / 10**6

@jit(nopython=True)
def cut(A, c, N):
    return (np.sum(np.ceil(A/c))-N)

c = np.ceil((ul+ll)/2)
mx = np.max(A)
while True:
    if ul-ll <= 1:
        break
    nk = cut(A, c, N)
    if verbose:
        print('c:', c, 'nk:', nk, 'ul - ll:', ul, '/', ll)
    prev = c
    if nk  >K: # more cuts than target; larger logs can be made
        ll = c
        c = np.floor((ul + c)/2)
    else: #i.e. nk < K, less cuts than target
        ul = c
        c = np.ceil((c + ll)/2)
        
if cut(A, ll+EPS, N) >= K:
    print(np.min((np.max(A), int(ul))))
else:
    print(int(ll))
l = list(map(int, input().split()))
N, K = map(int, input().split())
i = 0
std = sorted(l, reverse = True)
print(sum(std[0:K]))

### FIXED CODE ###

N, K = map(int, input().split())
l = list(map(int, input().split()))
std = sorted(l, reverse = True)
print(sum(std[0:K]))
ans = [1, 2, 3]
ans.romove(int(input()))
ans.romove(int(input()))

print(ans)

### FIXED CODE ###

Answer = [1, 2, 3]

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

Answer.remove(A)
Answer.remove(B)

print(Answer[0])
from itertools import accumulate
N, M = map(int, input().split())
A = list(map(int, input().split()))

B = [0] + A
C = {}
B = list(accumulate(B))
for i in range(1, len(B)):
    if B[i]%M not in C:
        C[B[i]%M] = 1
    else:
        C[B[i]%M] += 1
ans = 0
for i in C.values():
    ans += i*(i-1)//2
if 0 in C:
    ans += C[0]
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
if N%K == 0:
  print(0)
else:
  print(1)
S = list(input())
ACGT = []
lentemp = 0
while len(S)>0:
    s = S.pop(0)

    if s == "A" or s == "C" or s == "G" or s == "T":
        lentemp += 1

    else:
        ACGT.append(lentemp)
        lentemp = 0

print(max(ACGT))



### FIXED CODE ###


S = list(input())
ACGT = []
lentemp = 0
while len(S)>0:
    s = S.pop(0)

    if s == "A" or s == "C" or s == "G" or s == "T":
        lentemp += 1

    else:
        ACGT.append(lentemp)
        lentemp = 0
ACGT.append(lentemp)

print(max(ACGT))
a=[2**i for i in range(7)]
import bisect
n=int(input())
s=bisect.bisect_left(a,n)
if n==a[s]:
    print(n)
    exit()
print(a[s-1])

### FIXED CODE ###

a=[2**i for i in range(8)]
import bisect
n=int(input())
s=bisect.bisect_left(a,n)
if n==a[s]:
    print(n)
    exit()
print(a[s-1])
import bisect

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

A.sort()
BC.sort(key=lambda x: x[1],reverse=True) 
ans=0
for j in range(M):
    if A[0]>=BC[j][1] or len(A)==0:
        break
    else:
        b=BC[j][0]
        c=BC[j][1]
        R=bisect.bisect_left(A,c)
        n=len(A)
        if R>b:
            del A[0:b]
            ans+=b*c
        else:
            del A[0:R]
            ans+=R*c
print(sum(A)+ans)

### FIXED CODE ###

import bisect

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

A.sort()
BC.sort(key=lambda x: x[1],reverse=True) 
ans=0
for j in range(M):
    if A[0]>=BC[j][1]:
        break
    else:
        b=BC[j][0]
        c=BC[j][1]
        R=bisect.bisect_left(A,c)
        n=len(A)
        if R>b:
            if n<=b:
                A=[]
                ans+=n*c
                break
            else:
                del A[0:b]
                ans+=b*c
        else:
            del A[0:R]
            ans+=R*c
    if len(A)==0:
        break        
print(sum(A)+ans)
import sys
input = sys.stdin.readline

################################################################################

x, a = map(int, input())
if x < a:
    print(0)
else:
    print(10)

### FIXED CODE ###

import sys
input = sys.stdin.readline
 
################################################################################
 
x, a = map(int, input().split())
if x < a:
    print(0)
else:
    print(10)
N, M, C = map(int, input().split())
B = list(map(int, input().split()))

correct_answer = 0

for i in range(N):
    A = list(map(int, input().split()))
    
    for j in range(M):
        sum_AB += A[j]*B[j]
    if sum_AB + C > 0:
        correct_answer += 1

print(correct_answer)

### FIXED CODE ###

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

correct_answer = 0

for i in range(N):
    A = list(map(int, input().split()))
    sum_AB = 0
    for j in range(M):
        sum_AB += A[j]*B[j]
    if sum_AB + C > 0:
        correct_answer += 1

print(correct_answer)
N = input()
N_len = len(N)
num = 0

for i in range(N_len):
  num += int(N(i))
  
if (num % 9 == 0):
  print("yes")
else:
  print("no")


### FIXED CODE ###

N = input()

num = 0

for n in N:
  num += int(n)
  
if num % 9 == 0:
  print("Yes")
else:
  print("No")
n=int(input())
a = list(map(int, input().split()))
for i in a:
  if a % 2=0:
    if a%3=0 or a%5=0:
      print('APPROVED')
      exit()
print('DENIED')

### FIXED CODE ###

n=int(input())
a = list(map(int, input().split()))
for i in a:
  if i % 2==0:
    if i % 3 == 0 or i % 5 ==0:
      continue
    else:
      print('DENIED')
      exit()
      
print('APPROVED')
#入力した整数が５、７、５であるならばTrueを返す
# int,int,int -> True 

def check7(x,y,z):
    if x == 7:
        if y == z :
            print("YES")
        else:
            print("NO")
    elif y == 7:
        if x == z :
            print("YES")
        else:
          print("NO")
    elif z == 7:
        if x == y:
          print("YES")
        else:
          print("NO")
    else:
      print("NO")

if __name__ == "__main__":
    check7()


### FIXED CODE ###

# -*- coding: utf-8 -*-

input_list = input().split()

cnt7 = 0
cnt5 = 0

for n in input_list:
    if int(n) == 7:
        cnt7 += 1
    elif int(n) == 5:
        cnt5 += 1
    else:
        continue
if cnt7 == 1 and cnt5 == 2:
    print("YES")
else:
    print("NO")
S = int(input())
mod = 10 ** 9 + 7
dp = [0 for _ in range(S)]
dp[0] = dp[1] = 0
dp[2] = dp[3] = 1

for i in range(3, S):
    dp[i] = (dp[i - 3] + dp[i - 1]) % mod
    
print(dp[-1])

### FIXED CODE ###

import math


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

S = int(input())
ans = 0
mod = 10 ** 9 + 7
for i in range(1,700):
    x = S - 3 * i
    if x < 0:
        break
    ans += (combinations_count(x + i - 1, i - 1)) % mod
    ans %= mod
print(ans)
import sys
import bisect
input=sys.stdin.readline

n,m=map(int, input().split())
a=list(map(int, input().split()))

a.sort()

e=a[:n-m-1]
d=a[n-m-1:]
f=0

for _ in range(m):
    val=d.pop()//2
    if val > d[0]:
        bisect.insort(d, val)
    else:
        f+=val

print(sum(e)+sum(d)+f)


### FIXED CODE ###

import sys
import heapq
import numpy as np
input=sys.stdin.readline

n,m=map(int, input().split())
a=list(map(int, input().split()))
h=[]
for val in a:
    heapq.heappush(h, -val)

for _ in range(m):
    val=(-heapq.heappop(h))//2
    heapq.heappush(h, -val)

print(-sum(h))
N = int(input())
A_list = list(map(int, input().split()))

ans_list = []
for i in range(1, N + 1):
    ans_list.append(A_list.index(i) + 1)
    
print(' '.join([str(n) for n in ans_list]))


### FIXED CODE ###

N, K = map(int, input().split())
h_list = [int(i) for i in input().split()]

count = 0
for i in h_list:
    if i >= K:
        count += 1
    else:
        pass

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

if(A*T > B):
    print(B)
else:
    print(A*T)

### FIXED CODE ###

T,A,B = map(int,input().split())

if(A*T > B):
    print(B)
else:
    print(A*T)
x,n=map(int,input().split())
p=set(map(int,input().split()))

s=set()
for i in range(1,101):
    s.add(i)

s=list(s-p)

a=[abs(x-i) for i in s]
print(s[a.index(min(a))])

### FIXED CODE ###

x,n=map(int,input().split())
p=set(map(int,input().split()))

s=set()
for i in range(-100,201):
    s.add(i)

s=list(s-p)

a=[abs(x-i) for i in s]
print(s[a.index(min(a))])
import math


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


n, k = map(int, input().split())
mod = 10**9+7
for i in range(1, k+1):
    print(comb(n-k+1, i)*comb(k-1, i-1) % mod)


### FIXED CODE ###

import math


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


n, k = map(int, input().split())
mod = 10**9+7
for i in range(1, k+1):
    if n-k+1 >= i:
        print(comb(n-k+1, i)*comb(k-1, i-1) % mod)
    else:
        print(0)