Harryxun/stf_run huggingface dataset:
import math
n, k = map(int, input().split())
arr = list(map(int, input().split()))

max_length = max(arr)
low = 0
high = max_length

while low <= high:
  mid = (low + high) //2
  cnt = 0
  for i in range(n):
    cnt += math.ceil(arr[i]/mid) - 1
  if cnt > k:
    low = mid + 1
  else:
    high = mid -1
    max_length = mid

print(max_length)


### FIXED CODE ###

import math
n, k = map(int, input().split())
arr = list(map(int, input().split()))

max_length = max(arr)
low = 1
high = max_length - 1

while low <= high:
  mid = (low + high) //2
  cnt = 0
  for i in range(n):
    cnt += math.ceil(arr[i]/mid) - 1
  if cnt > k:
    low = mid + 1
  else:
    high = mid -1
    max_length = mid

print(max_length)
a, b = map(int, input().split())
if (a % 2 != 0) and (b % 2 != 0):
  return "Odd"
else:
  return "Even"

### FIXED CODE ###

a, b = map(int, input().split())
if (a % 2 != 0) and (b % 2 != 0):
  print("Odd")
else:
  print("Even")
N, R = int(input()).split()

if N<10:
  K = 100*(10-N)
  print(R+K)

### FIXED CODE ###

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

ans = 100*(10-N)+R
if N>=10:
  print(R)
else:
  print(ans)
a, b, c = map(int,input().split())

if　(a + b) <= C:
  print("Yes")
  
else:
  print("No")


### FIXED CODE ###

a, b, c = map(int,input().split())

if (a + b) >= c:
  print("Yes")
  
else:
  print("No")
n = int(input())
ans = 0
for i in range(n):
  a, b = map(str, input().split())
  if b = 'JPY':
    ans += int(a)
  else:
    ans += int(a) * 380000
print(ans)


### FIXED CODE ###

n = int(input())
ans = 0
for i in range(n):
  a, b = map(str, input().split())
  if b == 'JPY':
    ans += float(a)
  else:
    ans += float(a) * 380000
print(ans)
N = int(input())

if N % 2 = 0:
    print(int(N))
else:
    print(int(N + 1))

### FIXED CODE ###

N = int(input())

if N % 2 == 0:
    print(N // 2)
else:
    print(N // 2 + 1)
while True:
    try:
        a = int(input())
        b = int(input())
        print(len(str(a + b)))
    except EOFError:
        break



### FIXED CODE ###

while True:
    try:
        a, b = map(int, input().split(" "))
        print(len(str(a + b)))
    except:
        break
n=int(input())

div1 = 1
div2 = n
result = 10**12
if n == 1:
  print('0')
  exit()

for i in range(1,int(-(-n**0.5//1))+1):
  if n % i == 0:
    div1 *= i
    div2 /= i
    div_sum = div1 + div2
    result = min(result, div_sum)
print(int(div_sum-2))


### FIXED CODE ###

n=int(input())

div = n
result = 10**12

for i in range(1,1000001):
  if n % i == 0:
    div = n // i
    result = min(result, i+div)

print(int(result-2))
def sum_ans(data):
    if sum(data) == 15:
        print("+")


def main():
    inputs = input()
    data = inputs.split(" ")
    m = max(data)
    ans = 15
    if m > 15:
        print("x")
    else:
        sum_ans()
        if data[0] * data[1] == 15:
            print("*")
        elif data[0] * data[1] < 15:
            print("x")
        
if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    inputs = input()
    data = inputs.split(" ")
    data = [int(d) for d in data]
    m = max(data)
    ans = 15
    if int(m) > 15:
        print("x")
    else:
        s = sum(data)
        if data[0] * data[1] == 15:
            print("*")
        elif s == 15:
            print("+")
        else:
            print("x")
        
if __name__ == "__main__":
    main()
a,b,t=map(int,input().split())
T=a
cnt=0
while T<=t:
    ans+=b
    T+=a
print(cnt)


### FIXED CODE ###

a,b,t=map(int,input().split())
T=a
ans=0
while T<t+0.5:
    ans+=b
    T+=a
print(ans)
import random


def main():
    N = int(input())
    a = list(map(int, input().split()))
    ans = 0
    for _ in range(10**4):
        tmp = a.copy()
        all = list(range(N))
        not_aten = set(all)
        while not_aten:
            x = random.choice(all)
            tmp[x] -= 1
            if tmp[x] == 0:
                not_aten.remove(x)
            ans += 1
    print(ans/10**4)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    N = int(input())
    a = map(int, input().split())
    single = double = triple = 0
    for sushi in a:
        if sushi == 1:
            single += 1
        elif sushi == 2:
            double += 1
        elif sushi == 3:
            triple += 1
    dp = [[[0 for i in range(1+single+double+triple-j-k)]
           for j in range(double + triple + 1 - k)] for k in range(triple + 1)]
    for k in range(triple+1):
        for j in range(double + triple + 1-k):
            for i in range(1+single+double+triple-j-k):
                if i == 0 and j == 0 and k == 0:
                    continue
                first = second = third = 0
                if i-1 >= 0 and j >= 0 and k >= 0:
                    first = dp[k][j][i-1]
                if i+1 >= 0 and j-1 >= 0 and k >= 0:
                    second = dp[k][j - 1][i+1]
                if i >= 0 and j+1 >= 0 and k-1 >= 0:
                    third = dp[k-1][j + 1][i]
                dp[k][j][i] = (first*i + second * j +
                               third * k + N) / (i + j + k)
    print(dp[triple][double][single])


if __name__ == "__main__":
    main()
N = int(input())
h = [int(i) for i in input().split()]
def jump_min(n):
    if n == 1:
        v = 0
    elif n == 2:
        v = abs(h[1]-h[0])
    else:
        x = jump_min(n-2)+abs(h[n-1]-h[n-3])
        y = jump_min(n-1)+abs(h[n-1]-h[n-2])
        v = min(x,y)
    return v
print(jump_min(N))
        

### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)
N = int(input())
h = [int(i) for i in input().split()]
cost = [-1]*N
def jump_min(n):
    if n == 1:
        v = 0
    elif n == 2:
        v = abs(h[1]-h[0])
    else:
        if cost[n-1] != -1:
            v = cost[n-1]
        else:
            x = jump_min(n-2)+abs(h[n-1]-h[n-3])
            y = jump_min(n-1)+abs(h[n-1]-h[n-2])
            v = min(x,y)
    cost[n-1] = v
    return v
print(jump_min(N))
N,M =map(str,input().split())

N1=math.factorial(N)//(math.factorial(N-2)*2)
M1=math.factorial(M)//(math.factorial(M-2)*2)

print(N1+M1)

### FIXED CODE ###

import math
N,M =map(int,input().split())
if N==1 :
    N1=0
elif N==0:
    N1=0
else:
    N1=(math.factorial(N))//(math.factorial(N-2)*2)
    
if M==1:    
    M1=0
    
elif M ==0:
    M1=0
else:
    M1=(math.factorial(M))//(math.factorial(M-2)*2)
    
print(str(N1+M1))
import bisect

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

tree = [[] for i in range(N)]
for i in range(N-1):
  u, v = map(int, input().split())
  tree[u-1].append(v-1)
  tree[v-1].append(u-1)


ans = [0] * N
ans[0] = 1
dp = []
def dfs(node, par, dp):
  global ans
  children = tree[node]
  for child in children:
    if child == par:
      continue
    num = A[child]
    idx = bisect.bisect_left(dp, num)
    if idx == len(dp):
      _dp = dp.copy() + [num]
      ans[child] = idx + 1
      dfs(child, node, _dp)
    else:
      _dp = dp.copy()
      _dp[idx] = num
      ans[child] = idx + 1
      dfs(child, node, _dp)

dp = [A[0]]
dfs(0, -1, dp)
print(*ans, sep='\n')

### FIXED CODE ###

import bisect
import sys
sys.setrecursionlimit(10**9)

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

tree = [[] for i in range(N)]
for i in range(N-1):
  u, v = map(int, input().split())
  tree[u-1].append(v-1); tree[v-1].append(u-1)


ans = [0] * N
ans[0] = 1
INF = 10**10
dp = [INF] * N
dp[0] = A[0]
stack = []
def dfs(node, par):
  global ans
  global dp
  global stack
  children = tree[node]
  for child in children:
    if child == par:
      continue
    num = A[child]
    idx = bisect.bisect_left(dp, num)
    stack.append([idx, dp[idx]])
    dp[idx] = num
    ans[child] = bisect.bisect_left(dp, INF)
    dfs(child, node)
    # 巻き戻し
    idx, num = stack.pop()
    dp[idx] = num

dfs(0, -1)
print(*ans, sep='\n')
N,W = map(int,input().split())
wv = [list(map(int,input().split())) for _ in range(N)]
import numpy as np
dp = np.zeros(W+1)
for w,v in wv:
    np.maximum(dp[w:],dp[:-w]+v,out=dp[w:])
print(int(dp.max()))

### FIXED CODE ###

N,W = map(int,input().split())
import numpy as np
dp = np.full(N*1000 +1,W+1,dtype=np.int64)
dp[0]=0
for _ in range(N):
    w,v = map(int,input().split())
    dp[v:] = np.minimum(dp[:-v] + w, dp[v:])
print(np.max(np.where(dp <= W)))
import math

N = int(input())

sn = math.sqrt(N) // 1
a = 0

for i in range(1, sn + 1):
  if N % i == 0:
    a = i
    break

print(int(i + (N / i) - 2))

### FIXED CODE ###

import math

N = int(input())

sn = int(math.sqrt(N) // 1)
ans = N

for i in range(1, sn + 1):
  if N % i == 0:
    ans = min(ans, int(i + (N / i) - 2))

print(ans)
size = int(input())
array =  list(map(int, input().split()))
dp = [0]* size
for i in range(1,size):
	dp[i] = min(
	dp[i-1] + abs(array[i] - array[i-1]),
	dp[i-2] ,abs( array[i] - array[i-2] )]
	)
print(dp[-1])
		

### FIXED CODE ###

size = int(input())
array =  list(map(int, input().split()))
dp = [0]* size
dp[1]=  dp[0] + abs(array[1] - array[0]) 
for i in range(2,size):
	dp[i] = min(
	dp[i-1] + abs(array[i] - array[i-1]),
	dp[i-2] + abs( array[i] - array[i-2] )
	)
print(dp[-1])
S = input()
S[0:3]="2018"
print(S)

### FIXED CODE ###

S = list(input())
S[3] = "8"
print("".join(S))
a,b,c,k=map(int,input().split)
max_value=0
if k=<a+b:
  max_value=a
elif a+b<k=<a+b+c:
  max_value=a-k+a+b
print(max_value)

### FIXED CODE ###

a,b,c,k=map(int,input().split())
if a<=k<=a+b:
  max_value=a
elif k<a:
	max_value=k
else:
  max_value=a*2-k+b
print(max_value)
#"""
import sys
input = sys.stdin.readline
#"""

import scipy as sp

N = int(input())
S = input()
Q = int(input())
*K, = map(int,input().split())

nD = S.count("D")
nC = S.count("C")
if nD < nC:
    S = S[::-1].replace("D","c").replace("C","d").upper()

S = "A" + S
cs = sp.cumsum
ans = sp.zeros(Q,int)
D = sp.zeros(N+1,int)
cntM = sp.zeros(N+1,int)
sumM = sp.zeros(N+1,int)
M = []
C = []
for i,s in enumerate(S):
    if s=="D":
        D[i] = 1
    elif s=="M":
        M.append(i)
    elif s=="C":
        C.append(i-1)
D = cs(D)
for i in M:
    cntM[i] = 1
    sumM[i] = D[i]
cntM = cs(cntM)
sumM = cs(sumM)

for i in C:
    sMi = sumM[i]
    cMi = cntM[i]
    for j,k in enumerate(K):
        ik = max(0,i-k+1)
        ans[j] += (sMi-sumM[ik]) - D[ik]*(cMi-cntM[ik])
for out in ans:
    print(out)


### FIXED CODE ###

N = int(input())
S = input()
Q = int(input())
*K, = map(int,input().split())

nD = S.count("D")
nC = S.count("C")
if nD < nC:
    S = S[::-1].replace("D","c").replace("C","d").upper()

D = [0]*(N+1)
cntM = [0]*(N+1)
sumM = [0]*(N+1)
ans = [0]*Q
for i,s in enumerate(S):
    D[i+1] = D[i]
    cntM[i+1] = cntM[i]
    sumM[i+1] = sumM[i]
    if s=="D":
        D[i+1] += 1
    elif s=="M":
        cntM[i+1] += 1
        sumM[i+1] += D[i]
    elif s=="C":
        for j,k in enumerate(K):
            ik = max(0,i-k+1)
            d = D[ik]
            ans[j] += (sumM[i]-sumM[ik]) - d*(cntM[i]-cntM[ik])
for out in ans:
    print(out)
from itertools import permutations

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

Matrix = [[False for i in range(N)] for j in range(N)]

for i in range(N) :
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    Matrix[a][b] = True
    Matrix[b][a] = True
    Matrix[i][i] = True

arange = list(range(2,N+1))

ans = 0
for pm in permutations(arange) :
    pm = [1] + list(pm)
    for row,col in zip(pm,pm[1:]) :
        row -= 1
        col -= 1
        if not Matrix[row][col] :
            break
    else :
        ans += 1
print(ans)


### FIXED CODE ###

from itertools import permutations

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

L = [[False for i in range(N)] for j in range(N)]

for i in range(N) :
    L[i][i] = True
for i in range(M) :
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    L[a][b] = True
    L[b][a] = True

arange = range(2,N+1)

res = 0
for P in permutations(arange) :
    P = [1] + list(P)
    for S,G in zip(P,P[1:]) :
        if not L[S-1][G-1] :
            break
    else :
        res += 1
print(res)
import sys
from functools import lru_cache

sys.setrecursionlimit(10 ** 5)


N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
n, m = map(len, (A, B))


@lru_cache(None)
def dp(i, j, cur):
    if cur > K:
        return 0
    elif i >= n:
        if j < m and cur + B[j] <= K:
            return dp(i, j + 1, cur + B[j]) + 1
        else:
            return 0
    elif j >= m:
        if i < n and cur + A[i] <= K:
            return dp(i + 1, j, cur + A[i]) + 1
        else:
            return 0
    else:
        res = float('-inf')
        if cur + A[i] <= K:
            res = max(1 + dp(i + 1, j, cur + A[i]), res)
        if cur + B[j] <= K:
            res = max(1 + dp(i, j + 1, cur + B[j]), res)
        if res == float('-inf'):
            return 0
        else:
            return res


print(dp(0, 0, 0))

### FIXED CODE ###

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

prefix_A = [0] * (N + 1)
for i, a in enumerate(A, 1):
    prefix_A[i] = prefix_A[i - 1] + a
prefix_B = [0] * (M + 1)
for j, b in enumerate(B, 1):
    prefix_B[j] = prefix_B[j - 1] + b


res = 0
for i in range(N + 1):
    cur = prefix_A[i]
    if cur == K:
        res = max(i, res)
    elif cur < K:
        left = 0
        right = M + 1
        while right - left > 1:
            mid = (left + right) // 2
            if cur + prefix_B[mid] <= K:
                left = mid
            else:
                right = mid
        res = max(res, i + left)


print(res)
s = input()
t = input()

dp = [[0 for i in range(len(s)+2)] for j in range(len(t)+2)]

for i in range(len(s)):
    for j in range(len(t)):
        if s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + 1)
        dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j], dp[i][j+1])
        
ans = ""
i = len(s)
j = len(t)
while i > 0 and j > 0:
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        ans = s[i-1] + ans
        i -= 1
        j -= 1

print(ans)

### FIXED CODE ###

s = input()
t = input()

dp = [[0 for i in range(3010)] for j in range(3010)]

for i in range(len(s)):
    for j in range(len(t)):
        if s[i] == t[j]:
            dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + 1)
        dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j], dp[i][j+1])
        
ans = ""
i = len(s)
j = len(t)
while i > 0 and j > 0:
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        ans = s[i-1] + ans
        i -= 1
        j -= 1

print(ans)
T,X=(float(x) for x input().split())
print(T/X)

### FIXED CODE ###

T,X=map(int,input().split())
print(T/X)
# coding: utf-8
import math

A, B, C, D = map(int, input().split())
subst = abs(A - B)
num1 , num2, num3 = (subst // C + 1), (subst // D + 1), (subst // (C * D // math.gcd(C, D))) + 1

print(subst - num1 - num2 + num3 + 1)

### FIXED CODE ###

# coding: utf-8
# Your code here!
import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
    
a, b, c, d = map(int,input().split())
def cal(i, j, k):
    return i // j + i // k - i // lcm(j, k)

if a % c == 0 or a % d == 0:
    print(b - a - (cal(b, c, d) - cal(a, c, d)))
else:
    print(b - a - (cal(b, c, d) - cal(a, c, d)) + 1)
def f(n):
  c = 0
  while n % 2 == 0:
    c += 1
    n = n // 2
  return c

n = int(input())
a = list(map, int, input().split())
print(sum((f(ai) for ai in a if ai % 2 == 0)))


### FIXED CODE ###

def f(n):
  c = 0
  while n % 2 == 0:
    c += 1
    n = n // 2
  return c
 
n = int(input())
a = list(map(int, input().split()))
print(sum((f(ai) for ai in a if ai % 2 == 0)))
import math
import sys
sys.setrecursionlimit(10 ** 4)
N, K = map(int, input().split())
R = N - K

if K == 1:
    print (R+1)
    exit()

K_1 = math.factorial(K-1)
R_1 = math.factorial(R+1)
# print (K_1, R_1)
for i in range(1, K+1): #K回答えを出力
    # if i > R:
    #     print (0)
    #     continue
    if i == 1:
        print (R + 1)
        continue
    # print (K_1, R_1, math.factorial(i))
    if i == 2:
        position = R_1//(math.factorial(i) * math.factorial(R + 1- i))
        boal = K_1//(math.factorial(i-1) * math.factorial(K - i))
    if i > 2:
        position = (position * (R + 1 - (i-1))) // i
        boal = (boal * (K - (i-1)))// (i-1)
    print ((position * boal)%(7 + 10 ** 9))

### FIXED CODE ###

import math
import sys
sys.setrecursionlimit(10 ** 4)
N, K = map(int, input().split())
R = N - K

if R == 0: #赤いボールが無い時
    print (1)
    for _ in range(1, K):
        print (0)
    exit()

if K == 1: #青いボールが1つのとき
    print (R+1)
    exit()

K_1 = math.factorial(K-1)
R_1 = math.factorial(R+1)
# print (K_1, R_1)
for i in range(1, K+1): #K回答えを出力
    # if i > R:
    #     print (0)
    #     continue
    if i == 1:
        print (R + 1)
        continue
    # print (K_1, R_1, math.factorial(i))
    if i == 2:
        position = R_1//(math.factorial(i) * math.factorial(R + 1- i))
        boal = K_1//(math.factorial(i-1) * math.factorial(K - i))
    if i > 2:
        position = (position * (R + 1 - (i-1))) // i
        boal = (boal * (K - (i-1)))// (i-1)
    print ((position * boal)%(7 + 10 ** 9))
def solve(string):
    n, m, *abc = map(int, string.split())
    a = sorted(abc[:n])
    bc = sorted(list(zip(*[iter(abc[n:])] * 2)), key=lambda x: x[1])
    i = 0
    ans = 0
    for b, c in bc[::-1]:
        start = i
        while a[i] < c and b > 0:
            i += 1
            b -= 1
            ans += c
        if start == i:
            break
    ans += sum(a[i:])
    return str(ans)


if __name__ == '__main__':
    n, m = map(int, input().split())
    print(solve('{} {}\n'.format(n, m) + '\n'.join([input() for _ in range(m + 1)])))


### FIXED CODE ###

def solve(string):
    n, m, *abc = map(int, string.split())
    a = sorted(abc[:n])
    bc = sorted(list(zip(*[iter(abc[n:])] * 2)), key=lambda x: x[1])
    i = 0
    ans = 0
    for b, c in bc[::-1]:
        start = i
        while i < n and a[i] < c and b > 0:
            i += 1
            b -= 1
            ans += c
        if start == i:
            break
    ans += sum(a[i:]) if i < n else 0
    return str(ans)


if __name__ == '__main__':
    n, m = map(int, input().split())
    print(solve('{} {}\n'.format(n, m) + '\n'.join([input() for _ in range(m + 1)])))
n = int(input())
a = list(map(int, input().split()))
s = []
for i in range(1, n):
  s.append(abs(a[:i] - a[i:]))
print(max(s))
  

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
s = []
for i in range(1, n):
  s.append(abs(sum(a[:i]) - sum(a[i:])))
print(min(s))
from math import floor as f
A, B = map(int, input().split(" "))

ans = []
for c in range(10000):
    a = f(c * 0.08)
    b = f(c * 0.1)
    if a == A and b == B:
        print(c)
        break
else:
    print("-1")

### FIXED CODE ###

S = list(input())
if S.count(S[0]) == 3:
  print("No")
else:
  print("Yes")
N = []
N.append(input())

print("AC" + " x "+ count("AC"))
print("WA" + " x "+ count("WA"))
print("TLE" + " x "+ count("TLE"))
print("RE" + " x "+ count("RE"))

### FIXED CODE ###

N = int(input())
L=[input() for i in range(N)]

print("AC" + " x "+ str(L.count("AC")))
print("WA" + " x "+ str(L.count("WA")))
print("TLE" + " x "+ str(L.count("TLE")))
print("RE" + " x "+ str(L.count("RE")))
n, k, c = map(int, input().split())
s = input()


count = 0
i = 0
ansleft = set()
while i < n:
    if s[i] == "o":
        ansleft.add(i+1)
        i += c+1
        count += 1
    else:
        i += 1

if count >= k+1:
    sys.exit()


ansright = set()
s = s[::-1]
i = 0
while i < n:
    if s[i] == "o":
        ansright.add(n-i)
        i += c+1
    else:
        i += 1

ans = ansright&ansleft
ans = list(ans)
ans.sort()
for i in ans:
    print(i)


### FIXED CODE ###

import sys
n, k, c = map(int, input().split())
s = input()


count = 0
i = 0
ansleft = set()
while i < n:
    if s[i] == "o":
        ansleft.add(i+1)
        i += c+1
        count += 1
    else:
        i += 1

if count >= k+1:
    sys.exit()


ansright = set()
s = s[::-1]
i = 0
while i < n:
    if s[i] == "o":
        ansright.add(n-i)
        i += c+1
    else:
        i += 1

ans = ansright&ansleft
ans = list(ans)
ans.sort()
for i in ans:
    print(i)
N, A = map(int, input().split())
if ( N - A ) % 5 == 0:
	print("Yes")
else:
	print("No")

### FIXED CODE ###

n = int(input())
a = int(input())
if  n% 500 <= a:
	print("Yes")
else:
	print("No")
n, a = map(int, input().split())
x = list(map(int, input().split()))
x_max = max(x)
x_sum = sum(x)
if x_max < a:
    print(0)
else:
    dp = [[[0 for k in range(x_sum + 1)] for j in range(n + 1)] for i in range(n + 1)]
    dp[0][0][0] = 1
    for i in range(1, n + 1):
        for j in range(n + 1):
            for k in range(x[i - 1]):
                dp[i][j][k] = dp[i - 1][j][k]
            if j > 0:
                for k in range(x[i - 1], x_sum + 1):
                    dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - x[i - 1]]

    ans = 0
    for j in range(1, n + 1):
        ans += dp[-1][j][j * a]
    print(ans)


### FIXED CODE ###

n, a = map(int, input().split())
x = list(map(int, input().split()))
x_max = max(x)
x_sum = sum(x)
ans = 0
if x_max >= a:
    dp = [[0 for j in range(2 * x_sum + 1)] for i in range(2)]
    dp[0][x_sum] = 1
    for i in range(1, n + 1):
        idx = i % 2
        y = x[i - 1] - a
        for j in range(2 * x_sum + 1):
            if 0 <= j - y <= 2 * x_sum:
                dp[idx][j] = dp[1 - idx][j] + dp[1 - idx][j - y]
            else:
                dp[idx][j] = dp[1 - idx][j]
    ans = dp[n % 2][x_sum] - 1
print(ans)
n, m = (int(i) for i in input().split())
e = [[int(i) for i in input().split()] for i in range(n)]
dic = {}
for hobbies in e:
    for i in range(1,len(hobbies)+1):
        if hobbies[i] in dic:
            dic[hobbies[i]] +=1
        else:
            dic[hobbies[i]] = 0
everyoneLike = []
for key,num in dic.items():
    if num == n:
        everyoneLike.append(key)
print(len(everyoneLike))


### FIXED CODE ###

n, m = (int(i) for i in input().split())
e = [[int(i) for i in input().split()] for i in range(n)]
dic = {}
for hobbies in e:
    for i in range(1,len(hobbies)):
        if hobbies[i] in dic:
            dic[hobbies[i]] +=1
        else:
            dic[hobbies[i]] = 1
everyoneLike = []
for key,num in dic.items():
    if num == n:
        everyoneLike.append(key)
print(len(everyoneLike))
N = int(input())
n = N%10
if n == 2 or 4 or 5 or 7 or 9:
  print("hon")
elif n == 0 or 1 or 6 or 8:
  print("pon")
else n == 3:
  print("bon")


### FIXED CODE ###

N = int(input())
n = N%10
if n == 2 or n == 4 or n ==5 or n ==7 or n == 9:
  print("hon")
elif n == 0 or n == 1 or n == 6 or n == 8:
  print("pon")
else :
  print("bon")
# -*- coding: utf-8 -*-

#整数値龍力　複数の入力
def input_multiple_number():
    return map(int, input().split())

S = input()
K = int(input())

flagtail = 0
old_s = ""
cnt = 0
for s_ in S:
	if s_ == old_s:
		cnt +=1
		old_s = ""
	else:
		old_s = s_

ans = cnt * K

if S[-1] != S[-2] and S[0]==S[-1]:
	ans += (K-1)

print(ans)

### FIXED CODE ###

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

#整数値龍力　複数の入力
def input_multiple_number():
    return map(int, input().split())

S = input()
K = int(input())


if len(S) >= 1:
	flagtail = 0
	old_s = ""
	cnt = 0
	for s_ in S:
		if s_ == old_s:
			cnt +=1
			old_s = ""
		else:
			old_s = s_
	ans = cnt

	cnt1 = cnt
	old_s = ""

	if(K > 1 and K %2 == 0):
		S = S*2
		cnt1 = cnt
		cnt = 0
		old_s = ""
		for s_ in S:
			if s_ == old_s:
				cnt +=1
				old_s = ""
			else:
				old_s = s_

		ans = cnt1 + (cnt-cnt1)*(K-1)

	if(K > 1 and K %2 != 0):
		S = S*3
		cnt1 = cnt
		cnt = 0
		old_s = ""
		for s_ in S:
			if s_ == old_s:
				cnt +=1
				old_s = ""
			else:
				old_s = s_

		ans = cnt1 + (cnt-cnt1)*(K-1)//2
	print(ans)
else:
	print(K//2)
n=int(input())
for j in range(n):
    p=[float(i) for i in input().split()]
    ab=(p[3]-p[1])/(p[2]-p[0])
    cd=(p[7]-p[5])/(p[6]-p[4])
    if ab==cd:
        print("YES")
    else:
        print("NO")



### FIXED CODE ###

n=int(input())
for j in range(n):
    p=[float(i) for i in input().split()]
    if round((p[2]-p[0])*(p[7]-p[5])-(p[3]-p[1])*(p[6]-p[4]),10)==0:
        print("YES")
    else:
        print("NO")
s=input()
    v="CODEFESTIVAL2016"
    cnt=0
    for i in range(16):
        if s[i]!=v[i]:
            cnt+=1
    print(cnt)

### FIXED CODE ###

s=input()
v="CODEFESTIVAL2016"
cnt=0
for i in range(16):
    if s[i]==v[i]:
        cnt+=1
print(16-cnt)