Problem p02137 - Generation 1

Orig Description

Problem A: Special Chat
Problem
The popular video sharing site "ZouTube" is currently in the midst of a unprecedented "virtual ZouTuber" boom. Among them, the one that has recently attracted the most attention is the junior virtual ZouTuber "Aizumari Mu (aka: Azurimu)".
As a big fan of Azurimu, you plan to send her a "Special Chat" during her live stream today.
"Special Chat" is a function provided by ZouTube that allows viewers to give points to the streamer. For each Special Chat, viewers can consume either $500$, $1000$, $5000$, or $10000$ points, and give the same amount of points to the streamer.
Given the total amount of points you currently have, find the maximum number of points you can give to Azurimu by consuming your points. You can perform Special Chat as many times as you like as long as the number of points you consume does not exceed the number of points you have.
Input
The input is given in the following format:
$P$
An integer $P$ is given on a single line, which represents the total amount of points you currently have.
Constraints
The input satisfies the following conditions:
$1 \le P \le 10^5$
Output
Output the maximum number of points you can give to Azurimu on a single line.
Sample Input 1
5700
Sample Output 1
5500
Sample Input 2
1333
Sample Output 2
1000
Sample Input 3
100000
Sample Output 3
100000

Extracted Specification

An integer P (1 ≤ P ≤ 10^5), representing some quantity or value.

### Example Input:

```
5700
```

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

Test Case Generator

Sure, I can help you write a test case generator for the given problem statement "Special Chat". Here's a Python function that generates random test cases for this problem:

```python
import random

def tcgen():
    # Constraint for P: 1 ≤ P ≤ 10^5
    P = random.randint(1, 100000)
    return P

# Example of using the test case generator
if __name__ == "__main__":
    print(tcgen())
```

This function generates a random integer \( P \) within the given constraints, which represents the total amount of points you currently have. You can call this function to generate multiple test cases for the "Special Chat" problem. Here's how you might use it to generate and print several test cases:

```python
if __name__ == "__main__":
    for _ in range(10):  # Generate 10 test cases
        print(tcgen())
```

Feel free to modify the number of test cases or any other parameters as needed.

Extract Arguments

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