#AGC034C. [AGC034C] Tests
[AGC034C] Tests
Score : points
Problem Statement
Takahashi and Aoki will take exams numbered to . They have decided to compete in these exams. The winner will be determined as follows:
- For each exam , Takahashi decides its importance , which must be an integer between and (inclusive).
- Let be (Takahashi's score on Exam ), and be (Aoki's score on Exam ). Takahashi wins if , and Aoki wins if .
Takahashi knows that Aoki will score on Exam , with his supernatural power.
Takahashi himself, on the other hand, will score on all the exams without studying more. For each hour of study, he can increase his score on some exam by . (He can only study for an integer number of hours.) However, he cannot score more than X on an exam, since the perfect score for all the exams is .
Print the minimum number of study hours required for Takahashi to win.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum number of study hours required for Takahashi to win.
One optimal strategy is as follows:
- Choose .
- Study to score on Exam and on Exam .
Then, , and Takahashi will win.