Problem p00007 - Generation 2

Orig Description

Debt Hell
Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
Write a program which computes the amount of the debt in n weeks. 
Input
An integer n (0 ≤ n ≤ 100) is given in a line.
Output
Print the amout of the debt in a line.
Sample Input
5
Output for the Sample Input
130000

Extracted Specification

An integer n (0 ≤ n ≤ 100).

### Example Input:

```
5
```

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

Test Case Generator

Sure, I can write a test case generator for the "Debt Hell" problem. The generator will create random values for the input \(n\) and will compute the corresponding debt after \(n\) weeks according to the rules provided. 

Here's the test case generator in Python:

```python
import random
import math

def calculate_debt(n):
    debt = 100000
    for _ in range(n):
        debt = math.ceil(debt * 1.05 / 1000) * 1000
    return debt

def tcgen():
    n = random.randint(0, 100)
    debt = calculate_debt(n)
    return n, debt

# Example usage:
for _ in range(5):
    n, debt = tcgen()
    print(f"Input: {n}")
    print(f"Output: {debt}")
    print()
```

Explanation:
1. `calculate_debt(n)`: This function calculates the debt after \(n\) weeks.
   - Starts with an initial debt of 100,000 yen.
   - For each week, it increases the debt by 5%, rounds it up to the nearest 1,000 yen, and repeats this process.
   
2. `tcgen()`: This function generates a random test case.
   - Selects a random \(n\) (0 ≤ \(n\) ≤ 100).
   - Calculates the corresponding debt using the `calculate_debt` function.
   - Returns the input \(n\) and the computed debt.

You can use this generator to create multiple test cases and validate your solution against them.

Extract Arguments

def extract_arguments(fh):
    n = int(fh.readline().strip())
    return n