Problem:


Score : 100 points

Problem Statement

Serval is fighting with a monster.

The health of the monster is H.

In one attack, Serval can decrease the monster's health by A.
There is no other way to decrease the monster's health.

Serval wins when the monster's health becomes 0 or below.

Find the number of attacks Serval needs to make before winning.

Constraints

1 \leq H \leq 10^4

1 \leq A \leq 10^4

All values in input are integers.

Input

Input is given from Standard Input in the following format:

H A

Output

Print the number of attacks Serval needs to make before winning.

Sample Input 1

10 4

Sample Output 1

3

After one attack, the monster's health will be 6.

After two attacks, the monster's health will be 2.

After three attacks, the monster's health will be -2.

Thus, Serval needs to make three attacks to win.

Sample Input 2

1 10000

Sample Output 2

1

Sample Input 3

10000 1

Sample Output 3

10000



Sample input:
10 4


Sample output:
3

Submission status: Runtime Error

Solution code:
H,A = int(input().split())
n = 1
s = H - n*A
while True:
    if s <= 0:
        break
    if s >= 0:
        n += 1
        continue
    print(n)

Submission status: Runtime Error

Solution code:
H,A = int(input().split())
n = 1
s = H - n*A
while True:
    if s <= 0:
        break
    if s >= 0:
        n += 1
    print(n)

Submission status: Runtime Error

Solution code:
h, n = map(int, input().split())
dp = [10 ** 9] * (h+1)
dp[0] = 0

for ni in range(n):
  a, b = map(int, input().split())
  for hi in range(h):
    nj = min(j+a, h)
    dp[nj] = min(dp[nj], dp[j] + b)

print(dp[h])

Submission status: Runtime Error

Solution code:
import math.ceil
H,A = map(int,input().split())
print(ceil(H/A))

Submission status: Runtime Error

Solution code:
import sys

H, N = list(map(int, input().split()))
AB = [list(map(int, input().split())) for n in range(N)]

dp = [sys.maxsize for i in range(H+1)]
dp[0] = 0

# 各ダメージ段階の最小値を求める
for i in range(H):
    if dp[i] == sys.maxsize:
        continue
    # 各魔法を使って最小値なら更新
    for j in range(N):
        a = min(i + AB[j][0], H)
        b = dp[i] + AB[j][1]
        if dp[a] > b:
            dp[a] = b

print(dp[H])

Submission status: Runtime Error

Solution code:
'''
211 5
31 41 59 26 53
'''
power, moves = [int(x) for x in input().split()]
powers = sum([int(x) for x in input().split()])
print(["No","Yes"][powers >= power])

Submission status: Runtime Error

Solution code:
import sys

def use_dp():
    max_a = max([ab[0] for ab in AB])
    dp = [sys.maxsize for i in range(H+max_a)]
    dp[0] = 0

    # 各ダメージ段階の最小値を求める
    for i in range(H):
        if dp[i] == sys.maxsize:
            continue
        # 各魔法を使って最小値なら更新
        for j in range(N):
            a = i + AB[j][0]
            b = dp[i] + AB[j][1]
            if dp[a] > b:
                dp[a] = b

    # H < i < H+max(Ai)の範囲で最小値を求める
    min_mp = sys.maxsize
    for i in range(H, H+max_a):
        min_mp = min(dp[i], min_mp)

    print(min_mp)


if __name__ == '__main__':
    H, N = list(map(int, input().split()))
    AB = []
    for n in range(N):
        AB.append(list(map(int, input().split())))

    use_dp()

Submission status: Runtime Error

Solution code:
h,a = map(int, input().split())
print(h//a if !h%a else h//a + 1)

Submission status: Runtime Error

Solution code:
h,a = map(int, input().split())
print(int(h/a) if !h%a else int(h/a) + 1)

Submission status: Runtime Error

Solution code:
h, a = map(int, input.split())
if h % a == 0;
    print(h / a)
else
    print(h / a + 1)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
using namespace std;
  
int main () {
  int h, a;
  cin >> h >> a;
  if(h % a == 0) {
    cout << h / a;
  }
  else { 
    cout << h / a + 1;
  }
}

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
using namespace std;
  
int main () {
  int h, a;
  cin >> h >> a;
  if(h % a == 0);
    cout << h / a;
  else;
    cout << h / a + 1;
}

Submission status: Runtime Error

Solution code:
H,A = map(int,input().split())
ans = 0
B = int
while B > 0:
  B = H-A
  ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
H,A = map(int,input().split())
ans = 0
while B > 0:
  B = H-A
  ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
a,b= int(input()).split()

count=0
while a >0:
	a -= b
	count+=1
print(count)

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())

count=0
while a >0:
	a -= b
	count+=1
print(count)

Submission status: Runtime Error

Solution code:
H, N = map(int, input().split())
A = [int(x) for x in input().split()]
list2 = sorted(A, reverse=True)  # reverseをTrueに
if N>0:
    del list2[0:N]
    print(sum(list2))
elif N<0:
    print(sum(A))

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split())
T = list(map(int, input().split()))
T.sort()
if K>=N:
    print(0)
else:
    for i in range(K):
        T.pop()
    
    print(sum(T))

Submission status: Runtime Error

Solution code:
H = int(input("The health of the monster is "))
A = int(input("Serval can decrease the monster's health by "))
num = (H+A-1)/A
print(int(num))

Submission status: Runtime Error

Solution code:
#python 3.7.1
import math

a = int(input())
b = int(input())
c = a/b
print (math.ceil(c))

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <string>
#include <stdlib.h>
#include <fstream>
using namespace std;


int main() {
	long long h, a;
	cin >> h >> a;
	cout << h / a + !(!(h % a));
}

Submission status: Runtime Error

Solution code:
n, d, a = map(int, input().split())
monster = []
for _ in range(n):
  x, h = map(int, input().split())
  monster.append([x, h])
monster.sort()
bomb = 0
j = 0
for i in range(n):
  while j < n and monster[j][0] - monster[i][0] <= 2 * d:
    j += 1
  if monster[i][1] <= 0:
    continue
  b = (monster[i][1] - 1) // a + 1
  atk = a * b
  bomb += b
  for k in range(i+1, j):
    monster[k][1] -= atk
print(bomb)

Submission status: Runtime Error

Solution code:
def main():
  H,N = map(int,input().split())
  AB = [list(map(int,input().split())) for _ in range(N)]
  ab = min(AB,key = lambda x:x[1])
  INF = float('inf')
  dp = [INF]*(H+1)
  mi_a = ab[0]
  mi_b = ab[1]
  dp[0] = 0
  for i in range(1,H+1):
    if i<=mi_a:
      dp[i]=mi_b
    else:
      mi = float('inf')
      for a,b in AB:
        mi = min(mi,dp[max(0,i-a)]+b)
      if dp[i]>mi:
        dp[i] = mi

  print(dp[H])
  
main()

Submission status: Runtime Error

Solution code:
# No DP No LIFE
# 配るDP, 要復習
import sys, re, os
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
from bisect import bisect
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    H, N = MAP()
    L = [LIST() for i in range(N)]
    A = []
    B = []
    for i in range(N):
        A.append(L[i][0])
        B.append(L[i][1])

    dp = [INF] * 20010
    dp[0] = 0
    for i in range(10010):
        for j in range(N):
            dp[i+A[j]] = min(dp[i+A[j]], dp[i]+B[j])
    ans = INF
    for i in range(H, 20010):
        ans = min(ans, dp[i])
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n,k = map(int, input().split(' '))
h = list(map(int, input().split(' ')))
h.sort()

# print(n)
# print(k)
# print(h)

s = 0

i = 0
while i < len(h)-k:
  s += h[i]
  i += 1

print(s)

Submission status: Runtime Error

Solution code:
H, N = list(map(int, input().split()))

inf = 2**30
dp = [inf] * (H + 1)
dp[0] = 0
for i in range(N):
    A, B = list(map(int, input().split()))
    for j in range(H + 1):
        if dp[j] != inf:
            next = min(H, j + A)
            dp[next] = min(dp[next], dp[j] + B)

print(dp[H])

Submission status: Runtime Error

Solution code:
H, N = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

# AB = []
# for i in range(N):
#     A, B = map(int, input().split())
#     AB.append((A, B))


d = [0] + [10**18] * H

for hp in range(1, H + 1):
    for ab in AB:
        # print(ab)
        hp_remain = hp - ab[0]
        if hp_remain < 0: hp_remain = 0
        # print(hp_remain)
        c = d[hp_remain] + ab[1]
        if c < d[hp]: d[hp] = c

print(d[H])

Submission status: Runtime Error

Solution code:
H, N = map(int, input().split())
# AB = [list(map(int, input().split())) for _ in range(N)]

AB = []
for i in range(N):
    A, B = map(int, input().split())
    AB.append((A, B))


d = [0] + [10**18] * H

for hp in range(1, H + 1):
    for ab in AB:
        # print(ab)
        hp_remain = hp - ab[0]
        if hp_remain < 0: hp_remain = 0
        # print(hp_remain)
        c = d[hp_remain] + ab[1]
        if c < d[hp]: d[hp] = c

print(d[H])

Submission status: Runtime Error

Solution code:
from operator import itemgetter
import bisect
import math

N,d,a = map(int, input().split())
xh = sorted([list(map(int, input().split())) for i in range(N)], key=itemgetter(0))
x = []
for X,h in xh:
  x.append(X)
data0 = [0]*(N+1)
data1 = [0]*(N+1)

def _add(data, k, x):
    while k <= N:
        data[k] += x
        k += k & -k
def add(l, r, x):
    _add(data0, l, -x*(l-1))
    _add(data0, r, x*(r-1))
    _add(data1, l, x)
    _add(data1, r, -x)

def _get(data, k):
    s = 0
    while k:
        s += data[k]
        k -= k & -k
    return s
def query(l, r):
    return _get(data1, r-1) * (r-1) + _get(data0, r-1) - _get(data1, l-1) * (l-1) - _get(data0, l-1)

ans = 0

for L,(X,H) in enumerate(xh):
  L += 1
  R = bisect.bisect_right(x,X+2*d)
  res = math.ceil((H - query(L,L+1) * a) / a) #ansを変える
  ans += res
  add(L,R+1,res)
print(ans)

Submission status: Runtime Error

Solution code:
class Main:
    import math
    H = int(input())
    if H == 1:
        print(1)
    else:
        cnt = int(math.log(H, 2))
        num = 0
        for i in range(cnt+1):
            num += 2 ** i
    print(num)

Submission status: Runtime Error

Solution code:
class Main:
    import math
    H = int(input())
    if H == 1:
        print(1)
    else:
        cnt = int(math.log(H, 2))
        num = 0
        for i in range(cnt+1):
            num += 2 ** i
            print(num)

Submission status: Runtime Error

Solution code:
def attk(HP,Magic,D0):
    T = HP // Magic[0][0]
    MD0 = T * Magic[0][1]
    MD1 = (T+1) * Magic[0][1]
    Z = HP % Magic[0][0]
    ND = Magic[0][1]
    if Z == 0:
        return MD0
    if len(Magic) == 1:
        return MD1
    Magic.pop(0)
    A = attk(Z,Magic,ND)
    if D0 > MD0+A:
        if MD1 > MD0+A:
            return MD0+A
        else:
            return MD1
    else:
        return D0



H,N = map(int,input().split())
A =[]
for i in range(N):
    a,b = map(int,input().split())
    A.append((a,b,a/b))
#print(A)
B = sorted(A, key=lambda s: s[1]) 
C = sorted(B, key=lambda s: s[2], reverse=True) 
#print(C)

for i in range(N-1):
    if C[N-1-i][2] ==C[N-2-i][2]:
        C.pop(N-1-i)
#print(C)
TDMAX = (H // C[0][0])*C[0][1]
if (H%C[0][0])!=0:
    TDMAX += C[0][1]
TD = attk(H,C,TDMAX)
print(TD)

Submission status: Runtime Error

Solution code:

def main():
    import math

    H = int(input())
    if H == 1:
        print(1)
    else:
        count = int(math.log(H, 2))
        ans = 0
        for i in range(count+1):
            ans += 2 ** (i)
            print(ans)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import math

def main():
    H = int(input())
    if H == 1:
        print(1)
    else:
        count = int(math.log(H, 2))
        ans = 0
        for i in range(count+1):
            ans += 2 ** (i)
            print(ans)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import math
h= int(input())
a= int(input())
result = math.ceil(h/a)
print(result)

Submission status: Runtime Error

Solution code:
h, n = map(int, input().split())
a = []
b = []
for _ in range(n):
    ai, bi = map(int, input().split())
    a.append(ai)
    b.append(bi)
 
dp = [float("inf")] * (2 * 10000 + 1)
dp[0] = 0
for i in range(h):
    for j in range(n):
        if (i + a[j]) > 2 * 10000:
            dp[2 * 10000] = min(dp[2 * 10000], dp[i] + b[j])
            continue
        dp[i + a[j]] = min(dp[i + a[j]], dp[i] + b[j])
 
ans = float('inf')
for j in range(h, 2 * 10000 + 1):
    ans = min(ans, dp[j])
print(ans)

Submission status: Runtime Error

Solution code:
H, N = map(int, input().split())
AB = [[int(x) for x in input().split()] for _ in range(N)]
dp = [float('inf')] * (H + 1)
dp[0] = 0
for h in range(H + 1):
    for a, b in AB:
        h_new = min(h + a, H)
        dp[h_new] = min(dp[h] + b, dp[h_new])
print(dp[-1])

Submission status: Runtime Error

Solution code:
H = int(input())

g = int(H / 2)
ans = 0
if g == 0:
    print(1)
else:
    n = 0
    while True:
        if 2 ** (n + 1) < H:
            n += 1
        elif 2 ** (n + 1) >= H:
            n += 1
            break
    for i in range(n + 1):
        ans = ans + (2 ** i)
print(ans)

Submission status: Runtime Error

Solution code:
#include<iostream.h>
#include<conio.h>
int win(h,a)
{
	clrscr();
  	l=h;
    cnt=0;
  	while(l<=0)
    {
		l-=a;
    	cnt+=1;
    }
    return cnt;         
} 
void main()
{
h=10;
a=4
f=win(h,a);
cout<<f;
getch();
}

Submission status: Runtime Error

Solution code:
H,N = map(int,input().split())
A = list(map(int,input().split()))

if sum(A)>=H:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
h,a = tuple(map(int,input().rstrip().sprit()))
print((h+a-1)//a)

Submission status: Runtime Error

Solution code:
import numpy as np

s = input().split()
H = int(s[0])
N = int(s[1])

m = np.array([list(map(int, input().split())) for i in range(N)])
A = m[:, 0]
B = m[:, 1]

def func(H, m):
    A = m[:, 0]
    B = m[:, 1]

    if H < A[i]:
        i = np.argmin((H // A) * B)
        return (H // A[i]) * B[i]
    else:
        i = np.argmax(A / B)
        H_next = H - (H // A[i]) * B[i] 
        return (H // A[i]) * B[i] + func(H_next)
        
        func(H_next, )
        j = np.argmin(B)
        print((H // A[i])*B[i] + B[j])

print(func(H, m))

Submission status: Runtime Error

Solution code:
H,N = map(int,input().split())
A = list(map(int,input().split()))
s = sum (A)
if s>=H:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
H,N=map(int, input().split())
A = list(map(int, input().split()))

if(sum(A) > H):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
h,a = tuple(map(int,input().rstrip().sprit()))
print((h+a-1)//a)

Submission status: Runtime Error

Solution code:
h=int(input())
count=0
while  h>1:
	h = h // 2
	count += 1
print(2 ** (count+1) - 1)

Submission status: Runtime Error

Solution code:
import pandas as pd
import numpy as np

H, A = map(int, input().split())
life = float( H / A)

if life < float(0.9):
    print(1)
    
else:
    if life - round(life) == 0.5:
        print(round(life-0.5+1))
    else:
        print(round(life))

Submission status: Runtime Error

Solution code:
n = int(input())
a = [1]

if n % 2 == 1:
    n -= 1

if n % 2 == 0:
    for i in range(int(n / 2)):
        a.append(2 * a[i])

print(a[-1]*2 - 1)

Submission status: Runtime Error

Solution code:
def win(h,a):
    l=h
    cnt=0
    while(l>=0):
        l=l-a
        cnt+=1
    return cnt
  
h=int(input())
a=int(input())
print(win(h,a))

Submission status: Runtime Error

Solution code:
def main():
    from math import ceil
    from bisect import bisect_right
    N, D, A = map(int, input().split())
    Monsters = [list(map(int, input().split())) for i in range(N)]
    Monsters = sorted([[x, ceil(h / A)] for x, h in Monsters])


    class BIT2:
        """ 区間加算BIT(区間加算・区間合計取得) """

        def __init__(self, N):
            self.N = N
            self.data0 = [0] * N
            self.data1 = [0] * N

        def _add(self, data, k, x):
            while k < self.N:
                data[k] += x
                k += k & -k

        def _get(self, data, k):
            s = 0
            while k:
                s += data[k]
                k -= k & -k
            return s

        def add(self, l, r, x):
            """ 区間[l,r)に値xを追加 """

            self._add(self.data0, l, -x*(l-1))
            self._add(self.data0, r, x*(r-1))
            self._add(self.data1, l, x)
            self._add(self.data1, r, -x)

        def query(self, l, r):
            """ 区間[l,r)の和を取得 """

            return self._get(self.data1, r-1) * (r-1) + self._get(self.data0, r-1) \
                 - self._get(self.data1, l-1) * (l-1) - self._get(self.data0, l-1)


    RUQ = BIT2(2 * N)
    for i, (x, h) in enumerate(Monsters, start=1):
        RUQ.add(i, i + 1, h)


    i = 0
    ans = 0
    while i < N:
        cost = RUQ.query(i + 1, i + 2)
        if cost > 0:
            index = bisect_right(Monsters, [Monsters[i][0] + 2 * D, float('inf')])
            RUQ.add(i + 1, index + 1, -cost)
            ans += cost
        i += 1
        #
        # check = []
        # for j in range(1, N + 1):
        #     check.append(str(RUQ.query(j, j + 1)))
        # print(' '.join(check))

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))

H  int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))

H = int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
if result <= 0:
    rint("Yes")
else:
    rint("No")

Submission status: Runtime Error

Solution code:
import sys
import math
input=sys.stdin.readline
INF=1000000000
# A Dynamic Programming based Python Program for 0-1 Knapsack problem 
# Returns the maximum value that can be put in a knapsack of capacity W 
def knapSack(W,l, n):
    
    
    
    min_cost = [[0 for i in range(W+1)] for j in range(n+1)] 
    # fill 0th row with infinity 
    for i in range(W+1): 
        min_cost[0][i] = INF 
  
    # fill 0th column with 0 
    for i in range(1, n+1): 
        min_cost[i][0] = 0
    # now check for each weight one by one and fill the 
    # matrix according to the condition 
    for i in range(1, n+1): 
        for j in range(1, W+1): 
            # wt[i-1]>j means capacity of bag is 
            # less than weight of item 
            if (l[i-1][0] > j): 
                min_cost[i][j] = min(min_cost[i-1][j] ,l[i-1][1])
            # here we check we get minimum cost either 
            # by including it or excluding it 
            else: 
                min_cost[i][j] = min(min_cost[i-1][j], 
                    min_cost[i][j-l[i-1][0]] + l[i-1][1]) 
    
  
    # exactly weight W can not be made by given weights 
    if(min_cost[n][W] == INF): 
        return -1
    else: 
        return min_cost[n][W]

h,n=map(int,input().split())
l=list()
for i in range(n):
    a,b=map(int,input().split())
    l.append([a,b])
print( knapSack(h , l , n) )

Submission status: Runtime Error

Solution code:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))

H = int(l1[0])
N = int(l1[1])
A = int(sum(l2))
break
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
H, A = input().split()

print(int(H/A)+1)

Submission status: Runtime Error

Solution code:
H,N = map(int,input().split())
A = list(map(int,input().split()))
if sum(A)>=H:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
h=int(input())
count=0
while  h>1:
	h = h // 2
	conut += 1
print(2 ** (count+1) - 1)

Submission status: Runtime Error

Solution code:
H , A = input().split()
H , A = int(H), int(A)
answer = H // A
if H % A == 0:
    print(answer)
else:
    print(anser + 1)

Submission status: Runtime Error

Solution code:
H,N = list(map(int, input().split()))
A = []
B = []
for _ in range(N):
    a,b = list(map(int, input().split()))
    A.append(a)
    B.append(b)

dp = [float('inf') for i in range(H+max(A))]
dp[0] = 0

for i in range(H+max(A)):
    m = []
    for j in range(N):
        if i-A[j] >= 0:
            m.append(dp[i-A[j]]+B[j])
    m.append(dp[i])
    dp[i] = min(m)

print(min(dp[H:]))

Submission status: Runtime Error

Solution code:
import math
import sys

n,k = map(int, input().split())
hlist = input().split()
hlist.sort(reverse=True)

if (n-k) <= 0:
  print(0)
  sys.exit()
sum = 0
for i in range(n):
  if i > k-1:
    sum = sum + int(hlist[i])
print(sum)

Submission status: Runtime Error

Solution code:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))

print(l1)
H = int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))

H = int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
print(A)
if result <= 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
a=list(map(int,input().split()))
if K>=N:
	print(0)
else:
	b=sorted(a)
	c=0
	for i in range(N-K):
		c+=b[i]
	print(c)

Submission status: Runtime Error

Solution code:
H=int(input())
A=int(input())
count=0
while H>0:
    H=H-A
    count+=1
else:
    print(count)

Submission status: Runtime Error

Solution code:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))

H = int(l1[0])
N = int(l1[1])
A = int(sum(l2))
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
H = int(input())

cnt = 0
ans = 0

while H >= 1:
    H = H / 2
    if cnt == 0:
        cnt += 1
        ans += 1
    else:
        ans += cnt * 2
        cnt = cnt * 2

print(ans)

Submission status: Runtime Error

Solution code:
H = int(input())

memo_count = {}
def searchCount(h):
    if h==1: # 脱出条件
        return 1
    elif h in memo_count:
        return memo_count[h]
    else:
        h_half = int(h / 2)
        memo_count[h] = 1 + 2*searchCount(h_half)
        return memo_count[h]

print(searchCount(H))

Submission status: Runtime Error

Solution code:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))

H = l1[0]
N = l1[1]
A = sum(l2)
result = H - A
if result <= 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
from operator import itemgetter
H,N=map(int,input().split())
List=[]
A=0
B=0
C=10*10*10*10
D=0
for i in range(N):
    a,b=list(map(int,input().split()))
    c=a/b
    List.append((a,b,c))
List1=sorted(List,key=itemgetter(2))
List2=sorted(List,key=itemgetter(0))
for i in range(H):
    if A<H:
        h=H-A
        if h>=List1[N-1][0]:
            A=A+List1[N-1][0]
            B=B+List1[N-1][1]
        else:
            for j in range(N):
                if List2[j][0]>=h:
                    temp1=List2[j][0]
                    temp=List2[j][1]
                    if temp<=C:
                        C=temp
                        D=temp1
            B=B+C
            A=A+D
    elif A>=H:
        break
print(B)

Submission status: Runtime Error

Solution code:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))

H = l1[0]
N = l1[1]
A = sum(l2)
result = H - A
if result >0:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))

def attack2(l1, l2):
    H = l1[0]
    N = l1[1]
    A = sum(l2)
    result = H - A
    if result >0:
        return "No"
    else:
        return "Yes"
      
print(attack2(l1, l2))

Submission status: Runtime Error

Solution code:
H=int(input())
A=int(input())
count=0
while H>0:
    H=H-A
    count+=1
else:
print(count)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
h = list(map(int, input().split()))
H = sorted(h)[::-1]
ans = 0
if k >= len(h):
    print(0)
else:
    for i in H[k:]:
        ans += i
    print(ans)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
Hs = map(int,input().split())
print(sum(sorted(Hs, reverse=True)[K::]))

Submission status: Runtime Error

Solution code:
h,n=map(int,input().split())
A = list(map(int,input().split()))
if h >sum(A):
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
H, N = map(int, input().split())
move = [int(a) for a in map(int, input().split())]

smove = sum(move)
if smove >= H:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
h = int(input())
#a,b = map(int,input().split())
#a_L = list(map(int,input().split()))

#ans_L = [0] * (10**12 + 1)

i = 0
ans_L = [1]
while h!=1:
    h = h//2
    i += 1
    ans_L.append(2**i)

print(sum(ans_L))

Submission status: Runtime Error

Solution code:
h = int(input())
result, i = 0, 1
while h > 0:
    h //= 2
    result += i
    i *= 2
    
print(result)

Submission status: Runtime Error

Solution code:
H,A = map(int,input.split())
q,mod= divmod(H,A)

if mod >0:
  q +=1
  
print(q)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
h = list(map(int, input().split()))

h.sort()
for i in range(k):
    h.pop()
    if len(h) == 0:
        break
print(0 if len(h) == 0 else sum(h))

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;
using ll=long long;

#define faster ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define cint int t;cin>>t;while(t--)
#define rep(i,n) for(ll i=0;i<n;i++)
#define pii pair<int,int>
typedef vector<int> vint;
#define fi first
#define se second

ll mod=1e9+7;

int main(){
    faster;

    int h,a;
    cin>>h>>a;

    int ans=h/a+(h%a!=0);
    cout<<ans<<endl;
}

Submission status: Runtime Error

Solution code:
the_string = input()
a, b = the_string.split()
a = int(a)
b = int(b)
if a%%b = 0:
    ans = a/b
else:
    ans = a/b +1
print(ans)

Submission status: Runtime Error

Solution code:
H, N = [int(x) for x in input().split()]
attacks = [int(x) for x in input().split()]
print("Yes" if H - sum(attacks) <= 0 else "No")

Submission status: Runtime Error

Solution code:
n=int(input())
z=0
while n>0:
  z+=n
  n=n//2
print(z)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
N = list(map(int,input().split()))
print("Yes" if sum(N) >= a else "No")

Submission status: Runtime Error

Solution code:
h = int(input())
li = []
li.append(h)
c=1
while(h >  1):
    h= int(h/2)
    for i in range(2**c):   #計算量がクソ多くなる
        li.append(h)
    c += 1

#print(li)
print(len(li))

Submission status: Runtime Error

Solution code:
H =input()
A =input()
h = int(H)
a = int(A)
if h % a == 0:
    n = h // a
else:
    n = h // a +1
print(n)

Submission status: Runtime Error

Solution code:
def win(h,n,arr):
    cnt=0
    for i in range(n):
        h-=arr[i]
        if h<=0:
            cnt=1
    return cnt
  
h=int(input())
n=int(input())
arr=[]
for i in range(n):
    a=int(input("Enter"))
    arr.append(a)
l=win(h,n,arr)
if l==1:
    print("yes")
else:
    print("no")

Submission status: Runtime Error

Solution code:
from itertools import permutations, combinations

nums = input().split()
As = input().split()
H = nums[0]
N = nums[1]
A = []

sum = 0

for B in As:
    sum = sum + int(B)

if sum >=  int(H):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
H, A = input().split()

n = round((int(H)/int(A)) + 0.5)

print(n)10

Submission status: Runtime Error

Solution code:
a = input()
a = a.split(" ")
i = 0
while 1:
  if int(a[0])=<0:
    break
  else:
    i = i+1
    a[0]=int(a[0])-int(a[1])
    
print(i)

Submission status: Runtime Error

Solution code:
H=input()
A=input()
h = int(H)
a = int(A)
if mod(h,a) == 0:
    n = h // A
else:
    n = h // a +1
print(n)

Submission status: Runtime Error

Solution code:
H=input()
A=input()
h = int(H)
a = int(A)
if mod(H,A) == 0:
    n = H // A
else:
    n = H // A +1
print(n)

Submission status: Runtime Error

Solution code:
h, n = map(int , input().split())
a = list(map(int, input().split()))
sum = 0
for i in range(n):
    sum += a[i]
print(sum)
if (h <= sum):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
H,W=input().split(" ")
print(str(math.ceil(H / W)))

Submission status: Runtime Error

Solution code:
n = int(input())
if H % A == 0:
  print(n)
else:
  print(n+1)

Submission status: Runtime Error

Solution code:
import math
H,S = map(int,input().split())
i=1
if(H<=S):
  print(1)
elif(H>S):
  N = math.floor(H/S)
print(N)

Submission status: Runtime Error

Solution code:
H = int(input(""))
A = int(input(""))

i = 0
while H > 0:
    H -= A
    i += 1

print(i)

Submission status: Runtime Error

Solution code:
n = int(input())
if H % A ==0:
  print("n")
else:
  print("n+1")

Submission status: Runtime Error

Solution code:
import math

A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
print(math.ceil(H/A))

Submission status: Runtime Error

Solution code:
import math
A = [int(x) for x in input().split()]
H = [int(x) for x in input().split()]
print(math.ceil(H))

Submission status: Runtime Error

Solution code:
h, k = map(int, input().split())
lis = list(map(int, input().split()))
if h >= k:
    lis.sort(reverse=True)
    lis = lis[k:]
else:
    lis = []
    
print(sum(lis))

Submission status: Runtime Error

Solution code:
H=int(input('Enter monstwr health: '))
A=int(input('Enter the attack damage: '))
n=0
d=H/A
if (H%A==0):
 print(int(d))
else:
     d=d+1
     print(int(d))

Submission status: Runtime Error

Solution code:
i = input()
a,b = map(int, i.split())
c = 1

while a > b:
    a -= b
    c += 1
    else:
      print(c)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
a=list(int(x) for x in input().split())
a.sort()
s=0
if k <= n:
	print(0)
else:
		s = sum(a[:n-k])
		print(s)

Submission status: Runtime Error

Solution code:
n = int(input())
if H / A = n:
  print(n)
  else:
    print(n+1)

Submission status: Runtime Error

Solution code:
h=input()
a=input()
H = int(h)
A= int(a)
n = H // A + 1
print(n)

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split())
i=1
for(i in range(N)):
    He=N*i
    if(H<He):
      break
    else:
      continue
print(i)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
a=list(int(x) for x in input().split())
a.sort(reverse = True)
s=0
if k <= n:
	print(0)
else:
		s = sum(a[:n-k])
		print(s)

Submission status: Runtime Error

Solution code:
H=input()
A=input()
h = int(H)
a= int(A)
n :int= h // a + 1
print(n)

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
h = list(map(int,input().split()))

h.sort(reverse = True)

if k <= len(h):
    for i in range(k):
        h.pop(0)

    print(sum(h))

else:
    print("0")

Submission status: Runtime Error

Solution code:
H, A = [int(x) for x in input().split()]
print(math.ceil(H/A))