AtCoder Beginner Contest 153 - Serval vs Monster

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-----
10 4

-----Sample Output-----
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.

Difficulty: EASY

Starter code:

Solutions:
(h, a) = map(int, input().split())
ans = 0
for _ in range(h):
	h -= a
	ans += 1
	if h <= 0:
		break
print(ans)


(a, b) = [int(i) for i in input().split()]
print((a + b - 1) // b)


(H, A) = map(int, input().split())
n = H // A
if H % A != 0:
	n += 1
print(n)


(H, A) = map(int, input().split())
cnt = 0
while True:
	H = H - A
	cnt += 1
	if H <= 0:
		break
print(cnt)


(h, a) = map(int, input().split())
import math
print(math.ceil(h / a))


(H, A) = map(int, input().split())
q = H // A
mod = H % A
print(q + min(mod, 1))


(h, a) = map(int, input().split())
print((h - 1) // a + 1)


rStr = input()
H = int(rStr.split(' ')[0])
A = int(rStr.split(' ')[1])
count = 0
while 0 < H:
	H = H - A
	count = count + 1
print(count)


(a, b) = map(int, input().split())
print(-(-a // b))


(n, b) = map(int, input().split())
import math
print(math.ceil(n / b))


(H, A) = map(int, input().split(' '))
print(-(-H // A))


(x, y) = list(map(int, input().split()))
print((x + y - 1) // y)


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


(N, K) = [int(x) for x in input().split()]
print((N + K - 1) // K)


(h, a) = (int(i) for i in input().split())
print((h + a - 1) // a)


(h, a) = [int(x) for x in input().split()]
print((h + a - 1) // a)


(b, c) = map(int, input().split())
print((b + c - 1) // c)


a = [int(i) for i in input().split()]
print(-(-a[0] // a[1]))


(h, a) = list(map(int, input().split()))
c = 0
while h > 0:
	h -= a
	c += 1
print(c)


(a, b) = map(int, input().split())
print(a // b + (1 - int(a % b == 0)))


(h, w) = map(int, input().split())
print(-(h // -w))


(n, k) = map(int, input().split())
print(-(-n // k))


(H, A) = input().split()
S = 1
while int(H) - S * int(A) > 0:
	S += 1
print(S)


(H, A) = [int(x) for x in input().split()]
print((H - 1) // A + 1)


(h, a) = map(int, input().split())
i = 0
while h - a * i > 0:
	i += 1
print(i)


(hp, n) = map(int, input().split())
print(-(-hp // n))


(h, a) = list(map(int, input().split()))
b = 0
for i in range(10000000):
	if h > 0:
		h = h - a
		b = b + 1
	else:
		print(b)
		break


(h, a) = tuple(map(int, input().rstrip().split()))
print((h + a - 1) // a)


(H, A) = (int(x) for x in input().split())
print(H // A + (H % A > 0))


(H, A) = list(map(int, input().split()))
print((H + A - 1) // A)


(h, a) = list(map(int, input().split()))
print(h // a if h % a == 0 else h // a + 1)


(h, a) = map(int, input().split())
print(h // a + int(h % a != 0))


(h, a) = map(int, input().split())
print(int((h - 0.5) // a) + 1)


(x, y) = map(int, input().split())
s = -(-x // y)
print(s)


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


(a, b) = map(int, input().split())
a_b = -a // b
print(0 - a_b)


(H, A) = map(int, input().split())
ans = (H + A - 1) // A
print(ans)


(H, A) = [int(s) for s in input().split()]
print((H - 1) // A + 1)


(c, d) = (int(x) for x in input().split())
a = -(-c // d)
print(a)


(h, a) = map(int, input().split())
count = 0
while h > 0:
	count += 1
	h = h - a
print(count)


(H, A) = list(map(int, input().split()))
cnt = 0
while H > 0:
	cnt = cnt + 1
	H = H - A
print(cnt)


(h, a) = map(int, input().split())
ans = 0
while h > 0:
	h -= a
	ans += 1
print(ans)


(h, a) = map(int, input().split())
n = -(-h // a)
print(n)


(h, a) = map(int, input().split())
print(h // a + bool(h % a))


(n, a) = map(int, input().split())
print((n + a - 1) // a)


(h, a) = map(int, input().split())
t = 0
while h > 0:
	h -= a
	t += 1
print(t)


(N, M) = map(int, input().split())
print(-(-N // M))


import math
(A, B) = map(int, input().split())
print(math.ceil(A / B))


A = list(map(int, input().split()))
print(-(-A[0] // A[1]))


(H, A) = map(int, input().split())
count = 0
while H > 0:
	H -= A
	count += 1
print(count)


(H, A) = [int(i) for i in input().split()]
print(H // A + (H % A != 0))


(m, n) = map(int, input().split())
print((m + n - 1) // n)


ri = lambda S: [int(v) for v in S.split()]

def rii():
	return ri(input())
(H, A) = rii()
(H, r) = divmod(H, A)
r = 1 if r else r
print(H + r)


(a, b) = (int(x) for x in input().split())
print(-(-a // b))


(H, A) = map(int, input().split())
n = (H + A - 1) // A
print(n)


(H, A) = map(int, input().split())
i = 1
while H > A * i:
	i += 1
print(i)


from math import ceil
(h, a) = map(int, input().split())
n = ceil(h / a)
print(n)


(a, b) = map(int, input().split())
print(a // b + 1 if a % b != 0 else a // b)


(H, A) = map(int, input().split())
a = int(H / A)
b = H / A
if a == b:
	print(a)
else:
	c = a + 1
	print(c)


(h, a) = map(int, input().split())
cnt = -(-h // a)
print(cnt)


def main():
	(h, a) = map(int, input().split(' '))
	ans = 0
	while h > 0:
		h -= a
		ans += 1
	print(ans)

def __starting_point():
	main()
__starting_point()


(H, A) = map(int, input().split())
print(int((H - 0.5) // A + 1))


(h, a) = map(int, input().split())
h -= 0.01
print(int(h // a) + 1)


(H, A) = map(int, input().strip().split(' '))
print((H + (A - 1)) // A)


(H, A) = map(int, input().split())
x = H
s = 0
while H > 0:
	H = H - A
	s = s + 1
print(str(s))


(h, a) = map(int, input().split())
x = -(-h // a)
print(x)


(hp, attack) = map(int, input().split())
print(hp // attack if hp % attack == 0 else hp // attack + 1)


(H, A) = list(map(int, input().split()))
if H % A == 0:
	print(H // A)
else:
	print(H // A + 1)


(h, a) = map(int, input().split())
x = 0
if h % a > 0:
	x = 1
print(h // a + x)


(H, A) = map(int, input().split())
print(H // A + min(H % A, 1))


import math
(a, b) = map(float, input().split())
print(math.ceil(a / b))


from math import *
(n, m) = map(int, input().split())
print(ceil(n / m))


(h, a) = map(int, input().split())
ans = -(-h // a)
print(ans)


import sys, math, collections
from collections import defaultdict

def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w')

def get_array():
	l = list(map(int, input().split()))
	return l

def get_ints():
	return map(int, input().split())

def get_3_ints():
	(a, b, c) = map(int, input().split())
	return (a, b, c)

def sod(n):
	(n, c) = (str(n), 0)
	for i in n:
		c += int(i)
	return c

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def getFloor(A, x):
	(left, right) = (0, len(A) - 1)
	floor = -1
	while left <= right:
		mid = (left + right) // 2
		if A[mid] == x:
			return A[mid]
		elif x < A[mid]:
			right = mid - 1
		else:
			floor = A[mid]
			left = mid + 1
	return floor

def chk(aa, bb):
	f = 0
	for i in aa:
		for j in bb:
			if j[0] >= i[0] and j[1] <= i[1]:
				f += 1
			elif j[0] <= i[0] and j[1] >= i[1]:
				f += 1
			elif i[0] == j[1] or i[1] == j[0]:
				f += 1
			else:
				continue
	return f

def maxSumRangeQuery(nums, req):
	l = [0] * (len(nums) + 1)
	nums.sort(reverse=True)
	for i in req:
		l[i[0]] += 1
		l[i[1] + 1] -= 1
	for i in range(1, len(l)):
		l[i] += l[i - 1]
	l = l[:-1]
	d = collections.defaultdict(list)
	for i in range(len(l)):
		d[l[i]].append(i)
	di = collections.OrderedDict(sorted(d.items()))
	k = 0
	ans = [0] * len(nums)
	for i in di:
		for j in di[i]:
			ans[j] = nums[len(nums) - k - 1]
			k += 1
	c = 0
	for i in req:
		st = ans[i[0]:i[1] + 1]
		c += sum(st)
	return c % (10 ** 9 + 7)

def main():
	c = 0
	(a, b) = get_ints()
	while a > 0:
		a -= b
		c += 1
	print(c)

def __starting_point():
	main()
__starting_point()


print(-eval(('-' + input()).replace(' ', '//')))


(h, a) = list(map(int, input().split()))
print(-(-h // a))


(h, a) = list(map(int, input().split()))
count = 0
while h > 0:
	h -= a
	count += 1
	if h <= 0:
		break
print(count)


(H, A) = [int(n) for n in input().split()]
print(H // A if H % A == 0 else H // A + 1)


(H, Q) = map(int, input().split())
print((H - 1) // Q + 1)


(H, N) = map(int, input().split())
a = H // N
if H % N != 0:
	a += 1
print(a)


(H, A) = list(map(int, input().split()))
print(H // A + bool(H % A))


a = list(map(int, input().split()))
print((a[0] + a[1] - 1) // a[1])


(H, N) = map(int, input().split())
if H % N == 0:
	print(H // N)
elif H % N != 0:
	print(H // N + 1)


(a, b) = map(int, input().split())
w = a // b + (a % b != 0)
print(w)


(a, s) = map(int, input().split())
print((a + s - 1) // s)


(x, y) = map(int, input().split())
a = x // y
if x % y:
	a += 1
print(a)


(H, A) = map(int, input().split())
ans = H // A
if H % A != 0:
	ans = ans + 1
print(ans)


(H, A) = map(int, input().split())
print(H // A + 1 if H % A else H // A)


(H, A) = map(int, input().split())
Answer = (H + A - 1) // A
print(Answer)


(H, A) = map(int, input().split())
ans = H // A
mod = H % A
if mod == 0:
	print(ans)
else:
	print(ans + 1)


p = list(map(int, input().split()))
print((p[0] + p[1] - 1) // p[1])


(h, a) = (int(a) for a in input().split())
print(-(-h // a))


(H, A) = [int(i) for i in input().split()]
print((H + A - 1) // A)


import math
(H, A) = map(int, input().split())
print((H + A - 1) // A)


def solve(H: int, A: int):
	return (H + A - 1) // A

def main():
	(H, A) = list(map(int, input().split()))
	answer = solve(H, A)
	print(answer)

def __starting_point():
	main()
__starting_point()


(h, n) = list(map(int, input().split()))
print(-(-h // n))


(h, n) = (int(z) for z in input().split())
print((h + n - 1) // n)


(h, a) = [int(_) for _ in input().split()]
print((h - 1) // a + 1)


(a, u) = map(int, input().split())
print(-(-a // u))


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


(n, b) = map(int, input().split())
print(int(-1 * (-1 * n // b)))


(H, A) = map(int, input().split())
print(abs(-1 * H // A))


(H, A) = map(int, input().split())
r = (H + A - 1) // A
print(r)


[H, A] = [int(i) for i in input().split()]
t = 0
if H / A != int(H / A):
	t = 1
print(int(H / A) + t)


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


(H, A) = list(map(int, input().split()))
if H % A == 0:
	count_e = H // A
	print(count_e)
elif H < A:
	count_u = 1
	print(count_u)
elif H % A != 0:
	count_o = H // A + 1
	print(count_o)


(hp, attack) = map(int, input().split())
print(-(-hp // attack))


import math
(x, y) = map(int, input().split())
print(math.ceil(x / y))


import sys
sys.setrecursionlimit(10 ** 8)
ini = lambda : int(sys.stdin.readline())
inl = lambda : [int(x) for x in sys.stdin.readline().split()]
ins = lambda : sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print('\x1b[33m', *a, '\x1b[0m', **dict(file=sys.stderr, **kw))

def solve():
	(h, a) = inl()
	return (h + a - 1) // a
print(solve())


(h, a) = [int(i) for i in input().split()]
ans = h // a if h % a == 0 else h // a + 1
print(ans)


(h, a) = map(int, input().split())
for i in range(10 ** 4 + 1):
	if h - a * i <= 0:
		print(i)
		break


from math import ceil
(a, b) = map(int, input().split())
print(ceil(a / b))


(H, A) = list(map(int, input().split()))
k = 0
while H > 0:
	H -= A
	k += 1
print(k)


(h, a) = map(int, input().split())
print(h // a + (not not h % a))


(H, A) = map(int, input().split())
print(str((H + A - 1) // A))


import math
(n, k) = map(int, input().split())
print(math.ceil(n / k))


(h, a) = map(int, input().split())
if h % a == 0:
	ans = -1
else:
	ans = 0
while h >= 0:
	h -= a
	ans += 1
print(ans)


(a, c) = map(int, input().split())
count = 0
while a > 0:
	count += 1
	a -= c
print(count)