Problem p00312 - Generation 3

Orig Description

Frog's Straight Path Home
A frog is trying to get back to its nest. The nest is D centimeters away from the frog, and the frog moves straight towards the nest. The frog can only perform two actions:
 Big jump (move forward L centimeters)
 Small jump (move forward 1 centimeter)
The frog aims to land exactly on the nest without jumping over it.
Write a program to determine the minimum number of jumps the frog needs to make to reach its nest.
Input
The input is given in the following format:
D L
The input is given in one line, where D (1 ≤ D ≤ 10000) is the distance to the nest, and L (2 ≤ L ≤ 10000) is the distance the frog can jump with a big jump.
Output
Output the minimum number of jumps the frog needs to make in one line.
Sample Input 1
10 5
Sample Output 1
2
Sample Input 2
7 4
Sample Output 2
4

Extracted Specification

An integer D (1 ≤ D ≤ 10000), representing some quantity or size.
An integer L (2 ≤ L ≤ 10000), representing some size or length.

### Example Input:

```
10 5
```

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

Test Case Generator

Sure, I'll create a test case generator for the "Frog's Straight Path Home" problem. Here's the generator code which will randomly create valid test cases based on the provided problem constraints:

```python
import random

def frog_path_tcgen():
    # D is the distance to the nest (1 ≤ D ≤ 10000)
    D = random.randint(1, 10000)
    
    # L is the distance the frog can jump with a big jump (2 ≤ L ≤ 10000)
    L = random.randint(2, 10000)
    
    return D, L

# Function to print the generated test case in the required format
def print_test_case(D, L):
    print(f"{D} {L}")

# Generate a test case and print it
D, L = frog_path_tcgen()
print_test_case(D, L)
```

This generator will create random test cases for the problem while adhering to the constraints specified:

- \(D\) is the distance to the nest, generated randomly between 1 and 10000.
- \(L\) is the distance the frog can jump with a big jump, generated randomly between 2 and 10000.

Here's an example of how you might use this generator in a script:

```python
if __name__ == "__main__":
    # Generate a single test case
    D, L = frog_path_tcgen()
    print_test_case(D, L)
```

You can run this script to generate random test cases for the "Frog's Straight Path Home" problem. Each run will produce a different test case within the given constraints.

Extract Arguments

def extract_arguments(fh):
    D, L = map(int, fh.readline().strip().split())
    return D, L