Problem p02137 - Generation 3

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 size.

### Example Input:

```
5700
```

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

Test Case Generator

Sure! Below is a test case generator for the "Special Chat" problem:

```python
import random

def tcgen():
    # Generate a random amount of points P within the given constraints
    P = random.randint(1, 10**5)
    return P

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

This function generates a single random integer \(P\) within the range from 1 to \(10^5\), which represents the total amount of points you currently have. You can call this function multiple times to generate multiple test cases. The example usage at the bottom demonstrates generating and printing 10 test cases.

Extract Arguments

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

# if __name__ == "__main__":
#     input_path = sys.argv[1]
#     with open(input_path, 'r') as fh:
#     P = extract_arguments(fh)
#     f(P)