TLE '17 Contest 4 P1 - Riding the Curve

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type
A beauty in mathematics.

You have just recently written a mathematics exam. Your professor, Prof. Snew, is very nice and likes to adjust the marks so that his students' grades are higher.

The exam is initially out of M marks. Prof. Snew does the following to calculate a student's new mark:

Suppose the raw mark is X. Then, add K marks to the raw mark, and make the exam out of N marks. That is, the final mark is X+KN.

You now wonder to yourself, what is the minimum raw exam mark required to pass (at least 59.5%) after adjustment?

Input Specification

The first line of input will contain three integers, M (1M1000), K (1000K1000), and N (1N1000).

Output Specification

Output a single integer between 0 and M, the minimum raw exam mark required to pass. If it is impossible to pass, output have mercy snew instead.

Sample Input

Copy
50 32 80

Sample Output

Copy
16

Comments


  • 3
    DOUi  commented on Sept. 5, 2022, 7:43 p.m.

    If you are getting WA, remember that floating point errors exist