#P8840. [传智杯 #4 初赛] 报告赋分
[传智杯 #4 初赛] 报告赋分
Problem Description
At Chipmunk Tech University, the final assessment for the Computer Organization Principles lab is to submit a report.
However, as the course teacher, Teacher Luo does not want everyone to compete too hard, so the following rules are set:
Each report has a base score on the paper, denoted by .
Based on this:
-
If the report length is less than pages, points will be deducted. If the score becomes less than , it will be recorded as .
-
If the report length exceeds pages, for each page over , point will be deducted, until the score is reduced to .
Now you know a report’s base score and its number of pages . Please calculate the final score of this report. We guarantee that and .
Input Format
This problem has multiple test cases.
The first line contains an integer , representing the number of test cases.
The next lines each contain two integers , with the meaning as described above.
Output Format
Output a total of lines. Each line contains one integer, representing the final score for that query.
2
70 17
80 10
70
70
Hint
Translated by ChatGPT 5