Harryxun/stf_run huggingface dataset:
import numpy as np
import copy
N, M, X = map(int, input().split())
C = np.zeros(N, dtype=np.int64)
A = np.zeros([N, M], dtype=np.int64)
skills = np.zeros(M, dtype=np.int64)
sum_skills = np.zeros(M, dtype=np.int64)
sum_A = np.zeros(N, dtype=np.int64)

for n in range(N):
    CA = list(map(int, input().split()))
    C[n] = CA[0]
    A[n] = CA[1:]
    sum_skills += CA[1:]
    sum_A[n] = sum(CA[1:])


def check_skills(skills):
    return np.all(skills >= X)


if np.all(sum_skills >= X):
    pass
else:
    print("-1")
    exit()

results = []
book_sorted = np.argsort(sum_A)
for n in range(M):
    result = ([n], C[n].copy(), A[n].copy())
    results.append(result)

min_cost = np.sum(C)

while len(results) > 0:
    result = results.pop(0)
    if check_skills(result[2]):
        min_cost = min(min_cost, result[1])
    else:
        max_idx = max(result[0])
        for idx in range(max_idx+1, N):
            (idxes, total_cost, skill_values) = copy.copy(result)
            idxes = idxes + [idx]
            total_cost = total_cost + C[idx]
            skill_values = skill_values + A[idx]
            results.append((idxes, total_cost, skill_values))

print(min_cost)


### FIXED CODE ###

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

A = [[] for i in range(N)]
C = [0] * N
for i in range(N):
    c_as = list(map(int, input().split()))
    C[i], A[i] = c_as[0], c_as[1:]

INF = 10**9
ans = INF
for s in range(0, 1 << N):
    smart = [0] * M
    cost_sum = 0
    for i in range(N):
        if (s >> i) % 2 == 0:
            continue
        cost_sum += C[i]
        for j in range(M):
            smart[j] += A[i][j]
    ok = True
    for j in range(M):
        if smart[j] < X:
            ok = False
    if ok:
        ans = min(ans, cost_sum)
if ans == INF:
    ans = -1
print(ans)
s = input()
    print( sum( [ s[i]=='1' for i in range(len(s)) ] ) )

### FIXED CODE ###

def main():
    s = input()
    print( sum( [ s[i]=='1' for i in range(len(s)) ] ) )
    

if __name__ == "__main__":
    main()
import sys
import math
import numpy as np

if __name__ == '__main__':
    H, W, M = list(map(lambda x: int(x), sys.stdin.readline().split()))

    dic = {}
    # h = [0 for i in range(H)]
    # w = [0 for i in range(W)]
    h = np.zeros(H, dtype=np.int64)
    w = np.zeros(W, dtype=np.int64)
    for i in range(M):
        # P.append(list(map(lambda x: int(x), sys.stdin.readline().split())))
        x, y = list(map(lambda x: int(x), sys.stdin.readline().split()))
        x -= 1
        y -= 1
        h[x] += 1
        w[y] += 1
        dic[x*H+y] = 1
    
    lh = np.where(h == h.max())
    lw = np.where(w == w.max())

    mx = np.max(h)
    my = np.max(w)
    # print(mx, my)

    # print(lh[0])
    # print(lw[0])

    max = 0
    for i in lh[0]:
        for j in lw[0]:
            tmp = h[i] + w[j]
            if i*H+j in dic:
                tmp -= 1
            if tmp > max:
                max = tmp
    print(max)

### FIXED CODE ###

import sys
import math
import numpy as np

if __name__ == '__main__':
    H, W, M = list(map(lambda x: int(x), sys.stdin.readline().split()))

    dic = {}
    # h = [0 for i in range(H)]
    # w = [0 for i in range(W)]
    h = np.zeros(H, dtype=np.int64)
    w = np.zeros(W, dtype=np.int64)
    for i in range(M):
        # P.append(list(map(lambda x: int(x), sys.stdin.readline().split())))
        x, y = list(map(lambda x: int(x), sys.stdin.readline().split()))
        x -= 1
        y -= 1
        h[x] += 1
        w[y] += 1
        dic[x*H+y] = 1
    
    lh = np.where(h == h.max())
    lw = np.where(w == w.max())

    mx = np.max(h)
    my = np.max(w)
    # print(mx, my)

    # print(lh[0])
    # print(lw[0])


    tmp = mx + my
    for i in lh[0]:
        for j in lw[0]:
            if i*H+j not in dic:
                print(tmp)
                exit()
    print(tmp-1)
    exit()
import sys
import numpy as np

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


def main():
    N, K = map(int, input().split())
    A = np.array(list(map(int, input().split())))

    MOD = 10 ** 9 + 7

    pos = A[A >= 0]
    neg = A[A < 0]

    flag = False  # 積を正にできるか

    if N == K:
        ans = 1
        for a in A:
            ans *= a % MOD
        print(ans % MOD)
        exit()

    if len(pos) > 0:
        flag = True
    else:
        if K % 2 == 0:
            flag = True

    ans = 1
    if not flag:
        # 積を正にできないとき
        # 絶対値の小さい方からK個とる
        A = np.sort(np.abs(A))
        for a in A[:K]:
            ans *= a % MOD
        ans *= -1
    else:
        pos = np.sort(pos)
        neg = np.sort(neg)[::-1]
        if K % 2 == 1:
            # Kが奇数の時
            # 一番大きい偶数を1つとる。
            ans *= pos[-1]
            pos = pos[:-1]

        # pos, neg sort -> 2個ずつペア -> 降順sort -> 上から K//2 個とる
        newpos = pos[::-1][::2] * pos[::-1][1::2]
        newneg = neg[::2] * neg[1::2]
        pairs = np.concatenate([newpos, newneg])

        pairs = np.sort(pairs)[::-1]
        for i in range(K // 2):
            ans *= pairs[i] % MOD

    print(ans % MOD)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
import heapq

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


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    MOD = 10 ** 9 + 7

    pos = []
    neg = []
    for a in A:
        if a >= 0:
            pos.append(a)
        else:
            neg.append(a)

    flag = False  # 積を正にできるか

    if N == K:
        ans = 1
        for a in A:
            ans *= a
            ans %= MOD
        print(ans % MOD)
        exit()

    if len(pos) > 0:
        flag = True
    else:
        if K % 2 == 0:
            flag = True

    ans = 1
    if not flag:
        # 積を正にできないとき
        # 絶対値の小さい方からK個とる
        h = [abs(x) for x in A]
        heapq.heapify(h)

        for i in range(K):
            ans *= heapq.heappop(h)
            ans %= MOD
        ans *= -1
    else:
        hpos = [-x for x in pos]
        heapq.heapify(hpos)
        hneg = neg[:]
        heapq.heapify(hneg)
        if K % 2 == 1:
            # Kが奇数の時
            # 一番大きい偶数を1つとる。
            ans *= -heapq.heappop(hpos)
            ans %= MOD

        # pos, neg sort -> 2個ずつペア -> 降順sort -> 上から K//2 個とる
        pairs = []
        while len(hpos) >= 2:
            x = -heapq.heappop(hpos)
            x *= -heapq.heappop(hpos)
            heapq.heappush(pairs, -x)
        while len(hneg) >= 2:
            x = heapq.heappop(hneg)
            x *= heapq.heappop(hneg)
            heapq.heappush(pairs, -x)
        if len(pairs):
            for i in range(K // 2):
                ans *= -heapq.heappop(pairs)
                ans %= MOD

    print(ans % MOD)


if __name__ == "__main__":
    main()
input;n=list(map(itn,input().split()))
print(max(n) - min(n))

### FIXED CODE ###

input();n=list(map(int,input().split()))
print(max(n) - min(n))
import sys
input = sys.stdin.readline

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

a_set=set()

for index in range(m):
    a_set.add(int(input()))

ans_list=[0 * (n+1)]

for index in range(n + 1):
    if index == 0:
        ans_list[index] += 1
        continue
    if index == 1 and (index not in a_set):
        ans_list[index] += ans_list[index - 1]
        continue
    
    if index not in a_set:
        if (index - 1) not in a_set:
            ans_list[index] += ans_list[index - 1]
            ans_list[index] %= 1000000007
        if (index - 2) not in a_set:
            ans_list[index] += ans_list[index - 2]
            ans_list[index] %= 1000000007

print(ans_list[n])


### FIXED CODE ###

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

a_set=set()

for index in range(m):
    a_set.add(int(input()))

ans_list=[]

for index in range(n + 1):
    ans_list.append(0)

for index in range(n + 1):
    if index == 0:
        ans_list[index] += 1
        continue
    if index == 1 and (index not in a_set):
        ans_list[index] += ans_list[index - 1]
        continue
    
    if index not in a_set:
        if (index - 1) not in a_set:
            ans_list[index] += ans_list[index - 1]
            ans_list[index] %= 1000000007
        if (index - 2) not in a_set:
            ans_list[index] += ans_list[index - 2]
            ans_list[index] %= 1000000007

print(ans_list[n])
b = input()
if b = "A": 
    print("T")
elif b = "T":
    print("A")
elif b = "C":
    print("G")
elif b = "G":
    print("C")

### FIXED CODE ###

b = input()
if b == "A": 
    print("T")
elif b == "T":
    print("A")
elif b == "C":
    print("G")
elif b =="G":
    print("C")
A, B, K = map(int, input().split())
ans = set()
L = [i for i in range(A, B+1)]
for i in range(K):
  ans.add(L[i])
  ans.add(L[len(L - 1) - i ])
ans = sorted(list(ans))
for x in ans:
  print(x)

### FIXED CODE ###

A, B, K = map(int, input().split())
ans = []
for i in range(K):
  ans.append(A + i)
for i in range(1,K+1):
  if B-(K-i) not in ans:
    ans.append(B-(K-i))
for x in ans:
  if A <= x and x <= B:
    print(x)
w,h,x,y,r = map(int,input().split())
if x >= r and x =< w-r and y >= r and y =< h-r:
    print("Yes")
else:
    print("No")



### FIXED CODE ###

w,h,x,y,r = map(int,input().split())
if x >= r and x <= w-r and y >= r and y <= h-r:
    print("Yes")
else:
    print("No")
def bubble(A):
    flag = True
    n = len(A)
    i = 0
    while flag:
        flag = False
        for j in range(n-1,i,-1):
           if A[j][1] < A[j-1][1]:
               A[j],A[j-1] = A[j-1],A[j]
               flag = True
        i += 1
 
 
def selection(A):
    n = len(A)
    for i in range(n):
        minj = i
        for j in range(i,n):
            if A[j][1] < A[minj][1]:
                minj = j
        if i != minj:
            A[i],A[minj] = A[minj],A[i]
             
   
           
n = int(input())
ss = list(map(int,input().split()))
ss2 = ss.copy()
 
 
bubble(ss)
for i in range(len(ss)-1):
    print(ss[i], end=' ')
print(ss[-1])
print('Stable')
    
 
selection(ss2)
for i in range(len(ss2)-1):
    print(ss2[i], end=' ')
print(ss2[-1])
if ss == ss2:
    print('Stable')
else:
    print('Not stable')


### FIXED CODE ###

n = int(input())
*A, = input().split()
B = A[:]
for i in range(n):
    for j in range(n-1, i, -1):
        if A[j][1] < A[j-1][1]:
            A[j], A[j-1] = A[j-1], A[j]
print(*A)
print("Stable")
 
for i in range(n):
    minj = i
    for j in range(i, n):
        if B[j][1] < B[minj][1]:
            minj = j
    B[i], B[minj] = B[minj], B[i]
print(*B)
if A == B:
    print("Stable")
else:
    print("Not stable")
def resolve():
    n=int(input())
    h=list(map(int,input().split()))
    ans=[0 for i in range(n)]
    if h[0]<h[1]:
        ans[0]=0
    else:
        ans[0]=1
    for i in range(1,n-1):
        if h[i]<h[i+1]:
            ans[i]=0
        else:
            ans[i]=ans[i-1]+1
    print(max(ans))
resolve()

### FIXED CODE ###

def resolve():
    n=int(input())
    h=list(map(int,input().split()))
    if n==1:
      print(0)
    else:
        ans=[0 for i in range(n)]
        if h[0]<h[1]:
            ans[0]=0
        else:
            ans[0]=1
        for i in range(1,n-1):
            if h[i]<h[i+1]:
                ans[i]=0
            else:
                ans[i]=ans[i-1]+1
        print(max(ans))
resolve()
import math

A, B, C, D = map(int, input().split(' '))
num = B - A + 1
div_c = B // C - (A - 1) // C
div_d = B // D - (A - 1) // D
lcd = C * D // math.gcd(C, D)
div_cd = B // lcd - (A - 1) // lcd
print(num - div_c - div_d + div_cd)

### FIXED CODE ###

import sys
from fractions import gcd

input = sys.stdin.readline
A, B, C, D = map(int, input().split(' '))
num = B - A + 1
div_c = B // C - (A - 1) // C
div_d = B // D - (A - 1) // D
lcd = C * D // gcd(C, D)
div_cd = B // lcd - (A - 1) // lcd
print(num - div_c - div_d + div_cd)
n = int(input())
cost = 0
points = []
for i in range(n):
    xy = input().split()
    x = int(xy[0])
    y = int(xy[1])
    points.append((x,y))
#points.sort()
while len(points) != 0:
    p = points[-1][0] - points[-2][0]
    q = points[-1][1] - points[-2][1]
    xn = points[-1][0] - p
    yn = points[-1][1] - q
    cost +=1
    points.pop()
    print(p, " ", q)
    while len(points) != 0:
        if points[-1][0] == xn and points[-1][1] == yn:
            xn = points[-1][0] - p
            yn = points[-1][1] - q
            points.pop()
        else:
            break

print(cost)
    

### FIXED CODE ###

import sys
data = sys.stdin.readlines()
data = data[0].split()
N = int(data[0])
K = int(data[1])
if K == 1:
    print(0)
else:
    print(N-K)
a,b,c,k=map(int,input().split())
if k < a:
    print(k)
elif k <= a+b:
    print(a)
else:
    print(2a+b-k)

### FIXED CODE ###

a,b,c,k=map(int,input().split())
if k < a:
    print(k)
elif k <= a+b:
    print(a)
else:
    print(2*a+b-k)
for _ in[0]*int(input()):
 x=int(input())
 if 2 in[x,pow(2,x,x)]:c+=1
print(c)


### FIXED CODE ###

import sys
input()
def s():print(sum(2 in[x,pow(2,x,x)]for x in map(int,sys.stdin.readlines())))
if'__main__'==__name__:s()
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = [1,2,3,4,5,6]

for i in range(6)
    for j in range(j, 6)
        if max <= price[5] - price[i]:
            print max

### FIXED CODE ###

import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans
N = int(input())
a = list(map(int,input().split()))
one = 0
four = 0
two = 0

for j in range(N):

  if a[j]%2 == 1:
    one += 1
  elif a[j]%4 == 0:
    four += 1
  else :
    two +=1

  
if one <= four:
  print('Yes')
else :
  if two == 0:
    if four >= (one+1):
      print('Yes')
  else:
    print('No')

### FIXED CODE ###

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

print((n-1)*(m-1))
admission = []
n = int(input())
admission.append(map(int,input().split()))

for i in range(n):
    if admission[n] % 2 == 0:
        if admission[n] % 3 == 0 or admission[n] % 5 == 0:
            print("APPROVED")
        else:
            print("DENIED")


### FIXED CODE ###

n = int(input())
a = map(int,input().split())
for l in a:
    if l % 2 ==0:
        if l % 3 == 0 or l % 5 == 0:
            continue
        else:
            print("DENIED")
            quit()
print("APPROVED")
n = int(input())
vl = list(map(int, input().split()))
cl = list(map(int, input().split()))
ans = 0
for i in range(n):
    if vl[i] > cl[i]:
        ans += v[i]-c[i]
print(ans)

### FIXED CODE ###

n = int(input())
vl = list(map(int, input().split()))
cl = list(map(int, input().split()))
ans = 0
for i in range(n):
    if vl[i] > cl[i]:
        ans += vl[i]-cl[i]
print(ans)
def main():
    s = list(input())
    s.append("T")
    x,y = map(int,input().split())
    x_list = []
    y_list = []
    count = 0
    n = 0
    for i in range(len(s)+1):
        if s[i] == "F":
            count += 1
        else:
            if n == 0:
                x_list.append(count)
                n = 1
            else:
                y_list.append(count)
                n = 0
            count = 0
    x_def = {0}
    for i in x_list:
        x__def = set()
        for j in x_def:
            x__def.add(j+i)
            x__def.add(j-i)
        x_def = x__def
    if x not in x_def:
        print("No")
        exit()

    y_def = {0}
    for i in y_list:
        y__def = set()
        for j in y_def:
            y__def.add(j+i)
            y__def.add(j-i)
        y_def = y__def
    if y not in y_def:
        print("No")
        exit()
    print("Yes")

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
#input = sys.stdin.buffer.readline

def main():
    s = input().split("T")
    x,y = map(int,input().split())
    l = len(s)
    dx,dy = [len(s[0])],[0]
    nx,ny = [],[]
    for i in range(1,l):
        d = len(s[i])
        if i%2 == 0:
            nx = []
            for num in dx:
                nx.append(num+d)
                nx.append(num-d)
            dx = list(set(nx))
        else:
            ny = []
            for num in dy:
                ny.append(num+d)
                ny.append(num-d)
            dy = list(set(ny))

    if (x in dx and y in dy):
        print("Yes")
    else:
        print("No")
    
if __name__ == "__main__":
    main()
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n,m=map(int, input().split())
a = cmb(n, 2)
b = 0
if m != 1:
  b = cmb(m,2)
print(a+b)


### FIXED CODE ###

from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n,m=map(int, input().split())
a = 0
b = 0
if n > 1:
  a = cmb(n, 2)  
if m > 1:
  b = cmb(m,2)
print(a+b)
# -*- coding:utf-8 -*-
X=list(input())
A,B,C,D=map(int,X)
if A+B+C+D==7:
  print(A+'+'+B+'+'+C+'+'+D+'=7')
  exit()
if A+B+C-D==7:
  print(A+'+'+B+'+'+C+'-'+D+'=7')
  exit()
if A+B-C+D==7:
  print(A+'+'+B+'-'+C+'+'+D+'=7')
  exit()
if A-B+C+D==7:
  print(A+'-'+B+'+'+C+'+'+D+'=7')
  exit()
if A-B-C+D==7:
  print(A+'-'+B+'-'+C+'+'+D+'=7')
  exit()
if A+B-C-D==7:
  print(A+'+'+B+'-'+C+'-'+D+'=7')
  exit()
if A-B+C-D==7:
  print(A+'-'+B+'+'+C+'-'+D+'=7')
  exit()
if A-B-C-D==7:
  print(A+'-'+B+'-'+C+'-'+D+'=7')
  exit()

  

### FIXED CODE ###

# -*- coding:utf-8 -*-
X=list(input())
A,B,C,D=map(int,X)
if A+B+C+D==7:
  A=str(A)
  B=str(B)
  C=str(C)
  D=str(D)
  print(A+'+'+B+'+'+C+'+'+D+'=7')
  exit()
elif A+B+C-D==7:
  A=str(A)
  B=str(B)
  C=str(C)
  D=str(D)
  print(A+'+'+B+'+'+C+'-'+D+'=7')
  exit()
elif A+B-C+D==7:
  A=str(A)
  B=str(B)
  C=str(C)
  D=str(D)
  print(A+'+'+B+'-'+C+'+'+D+'=7')
  exit()
elif A-B+C+D==7:
  A=str(A)
  B=str(B)
  C=str(C)
  D=str(D)
  print(A+'-'+B+'+'+C+'+'+D+'=7')
  exit()
elif A-B-C+D==7:
  A=str(A)
  B=str(B)
  C=str(C)
  D=str(D)
  print(A+'-'+B+'-'+C+'+'+D+'=7')
  exit()
elif A+B-C-D==7:
  A=str(A)
  B=str(B)
  C=str(C)
  D=str(D)
  print(A+'+'+B+'-'+C+'-'+D+'=7')
  exit()
elif A-B+C-D==7:
  A=str(A)
  B=str(B)
  C=str(C)
  D=str(D)
  print(A+'-'+B+'+'+C+'-'+D+'=7')
  exit()
elif A-B-C-D==7:
  A=str(A)
  B=str(B)
  C=str(C)
  D=str(D)
  print(A+'-'+B+'-'+C+'-'+D+'=7')
  exit()
else:
  print('None')
print map(int,raw_input().split(' ')).sort().join(' ')

### FIXED CODE ###

a = sorted(map(int, raw_input().split(' ')))
for i in a:
    print i,
n,m=map(int,input().split())
food=list(range(1,m+1))
for i in range(n):
    k,*a=map(int,input().split())
    food &= set(a)
print(len(food))

### FIXED CODE ###

n,m,x,*a=map(int,open(0).read().split())
map=[0]*(n+1)
for i in a: map[i]=1
print(min(sum(map[0:x]),sum(map[x:n])))
from scipy.sparse import*
M=999
*s,=open(0)
*g,=eval('[0]*M,'*M)
i=0
for t in s:
 i+=1;j=0
 for u in t:k=i*20+j;g[k][k+20]=u>'#'<(s+['#'*M])[i][j];j+=1;g[k][k+1]=u>'#'<t[j]
a=csgraph.johnson(csr_matrix(g),0)
print(int(max(a[a<M])))

### FIXED CODE ###

from scipy.sparse import*
e=enumerate
h,*s=open(0)
h,w=map(int,h.split())
r,c=[],[]
for i,t in e(s):
  for j,u in e(t):
    if u>'#'<t[j+1]:r+=i*w+j,;c+=i*w+j+1,
    if(i<h-1)*u>'#'<s[i+1][j]:r+=i*w+j,;c+=j-~i*w,    
print(int((csgraph.johnson(csr_matrix(([1]*len(r),(r,c)),[h*w]*2),0).clip(0,999)%999).max()))
S=input()
S.sort()
if (S[0]==S[1])and(S[2]==S[3])and(S[0]!=S[1]):
  print('Yes')
else:
  print('No')
    

### FIXED CODE ###

S=list(input())
S.sort()
if (S[0]==S[1])and(S[2]==S[3])and(S[0]!=S[2]):
  print('Yes')
else:
  print('No')
n,k,m = map(int,input().split())
a = list(map(int,input().split()))

t = n*m - sum(a)
if 0<=t<=k:
 print(t)
if  k<t:
 print(-1)
else:
 print(0

### FIXED CODE ###

print(chr(ord(input())+1))
import sys 
RESOURCE_DICT = dict([(k,v) for k,v in zip(range(1,10),[2,5,5,4,5,6,3,7,6])])

def get_input():
    N,M = [ int(_) for _ in input().split()]
    A = [int(_) for _ in input().split()]
    return N,M,A


def solve(N,M,A):
    A = sorted(A)[::-1]
    dp = [ -100*N for _ in range(N+1)]
    dp[0] = 0
    for i in range(1,N+1):
        fill(A,dp,i,N)
    array = find_array(dp,N,A)
    return "".join(map(str,array))

def fill(A,dp,n,N):
    cand = [ dp[n-num]+1 for num in A if n - num >= 0 ]
    dp[n] = max(cand) if len(cand) > 0 else -100*N

def find_array(dp,N,A):
    array = []
    sorted_A = sorted(A)
    current_n = N
    for _ in range(dp[N]):
        for number in sorted_A[::-1]:
            if dp[current_n-RESOURCE_DICT[number]] == dp[current_n]-1:
                array.append(number)
                current_n -= RESOURCE_DICT[number]
                break                
    return array


if __name__ =="__main__":
    N,M,A = get_input()
    ans = solve(N,M,A)
    print(ans)

### FIXED CODE ###

import sys 
RESOURCE_DICT = dict([(k,v) for k,v in zip(range(1,10),[2,5,5,4,5,6,3,7,6])])

def get_input():
    N,M = [ int(_) for _ in input().split()]
    A = [int(_) for _ in input().split()]
    return N,M,A


def solve(N,M,A):
    sorted_A = sorted(A)[::-1]
    dp = fill_dp(N,sorted_A)
    array = find_array(dp,N,sorted_A)
    return "".join(map(str,array))

def fill_dp(N,A):
    dp = [ -100*N for _ in range(N+1)]
    dp[0] = 0
    for i in range(1,N+1):
        fill(A,dp,i,N)
    return dp

def fill(A,dp,n,N):
    cand = [ dp[n-RESOURCE_DICT[num]]+1 for num in A if n - RESOURCE_DICT[num] >= 0 ]
    dp[n] = max(cand) if len(cand) > 0  else -100*N

def find_array(dp,N,sorted_A):
    array = []
    current_n = N
    for _ in range(dp[N]):
        for number in sorted_A:
            if current_n-RESOURCE_DICT[number] >= 0  and dp[current_n-RESOURCE_DICT[number]] == dp[current_n]-1:
                array.append(number)
                current_n -= RESOURCE_DICT[number]
                break
    return array


if __name__ =="__main__":
    N,M,A = get_input()
    ans = solve(N,M,A)
    print(ans)
n = int(input())
l = list(map(int, input().split()))

print(sum([l[i]*x for i in range(len(l)-1) for x in l[i+1:]))

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))

print(sum(l[i]*x for i in range(len(l)-1) for x in l[i+1:]))
import math
n = int(raw_input())

for i in range(n):
    xa, ya, ra, xb, yb, rb = map(float, raw_input().split(' '))
    d = math.sqrt((xa-xb)**2 + (ya-yb)**2)
    if d+rb <= ra:
        print 2
    elif: d+ra <= rb:
        print -2
    elif: d > ra+rb:
        print 0
    else:
        print 1
    

### FIXED CODE ###

import math
n = int(raw_input())

for i in range(n):
    xa, ya, ra, xb, yb, rb = map(float, raw_input().split(' '))
    d = math.sqrt((xa-xb)**2 + (ya-yb)**2)
    if d+rb < ra:
        print 2
    elif d+ra < rb:
        print -2
    elif d > ra+rb:
        print 0
    else:
        print 1
a = int(input())
if a%9:
  print('No')
else:
  print('Yes')
  


### FIXED CODE ###

import numpy as np
a,b,c = map(int,input().split())
print(int(np.ceil(a/b)*c))