Problem p02783 - Generation 3

Orig Description

Score : 100 points
Problem StatementServal 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.
InputInput is given from Standard Input in the following format:
H A
OutputPrint the number of attacks Serval needs to make before winning.
Sample Input 110 4
Sample Output 13
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 21 10000
Sample Output 21
Sample Input 310000 1
Sample Output 310000

Extracted Specification

An integer H (1 ≤ H ≤ 10^4).
An integer A (1 ≤ A ≤ 10^4).

### Example Input:

```
10 4
```

### Function Signature:
Write a function f(H, A) that takes in the input.
def f(H: int, A: int):
    ''' 
    H: an integer 
    A: an integer
    '''

Test Case Generator

Certainly! Here is a test case generator for the given problem statement:

**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 ≤ \( H \) ≤ 10^4

1 ≤ \( A \) ≤ 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
```

**Explanation:**

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.

**Test Case Generator:**

```python
import random

def generate_test_case():
    H = random.randint(1, 10**4)
    A = random.randint(1, 10**4)
    return H, A

# Function to demonstrate the test case generation
def main():
    # Generate a test case
    H, A = generate_test_case()
    # Print the test case
    print(H, A)

if __name__ == "__main__":
    main()
```

This test case generator will randomly produce values for \( H \) and \( A \) within the specified constraints. Each call to `generate_test_case()` will yield a new pair of values suitable for testing the problem.

Extract Arguments

def extract_arguments(fh):
    H, A = map(int, fh.readline().strip().split())
    return H, A