Serval is fighting with a monster. The health of the monster is H. In one attack, Serval…
- User
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.
Examples
Input
10 4
Output
3
Input
1 10000
Output
1
Input
10000 1
Output
10000
Assistant
We need to read H and A, then compute minimal number of attacks needed to reduce health to <=0. Each attack reduces by A. So number needed is ceil(H / A). Since H and A are positive integers, this is (H + A - 1) // A in integer division. Output that number.
The problem is straightforward.
We need to provide a solution in Python, probably.
The user said: "Serval is fighting with a monster. ... Find the number of attacks Serval needs to make before winning." Provide solution.
We need to respond with code, explanation? The prompt: "We need to read H and A, then compute minimal number of attacks..." The user likely expects a solution code. In typical ChatGPT style for programming tasks, we output the code and maybe brief explanation.
I'll provide a Python solution.
Implementation:
def main(): import sys H, A = map(int, sys.stdin.read().split()) ans = (H + A - 1) // A print(ans)
if == "": main()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.