#P1818. 电影投票
电影投票
Description
There is a voting system that rates movies, where each vote must be an integer from to . We want to cast as few votes as possible so that a movie’s average score falls below a certain value.
Input Format
Multiple test cases. Each test case consists of a single line containing two real numbers with exactly one decimal place , , and a positive integer . Here, is the movie’s current average score rounded to one decimal place, is XP’s desired average score rounded to one decimal place, and the movie has already received votes. It is guaranteed that . Process until EOF.
Output Format
For each test case, output a positive integer , meaning that in the worst case, as long as XP casts votes, it is guaranteed that the movie’s average score rounded to one decimal place will be less than or equal to .
9.5 2.0 12
4.4 3.4 12478
10 3.4 23577
86
5094
63033
Hint
Constraints and Agreements
- For of the testdata, , .
- For of the testdata, , , .
Notes
Round to one decimal place using the round half up method. Real numbers may have precision errors.
Translated by ChatGPT 5
京公网安备 11011102002149号