#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 aa.

Based on this:

  • If the report length is less than 1616 pages, 1010 points will be deducted. If the score becomes less than 00, it will be recorded as 00.

  • If the report length exceeds 2020 pages, for each page over 2020, 11 point will be deducted, until the score is reduced to 00.

Now you know a report’s base score aa and its number of pages pp. Please calculate the final score of this report. We guarantee that 1a1001 \leq a \leq 100 and 1p501 \leq p \leq 50.

Input Format

This problem has multiple test cases.

The first line contains an integer TT (1T1000)(1 \leq T \leq 1000), representing the number of test cases.

The next TT lines each contain two integers a,pa, p, with the meaning as described above.

Output Format

Output a total of TT 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