At the start of the semester, your teacher hands you a course outline. The outline states that there will be
Your school has a weird scoring system. Instead of using percentages or letter grades, your school simply provides the average of your test scores on your report card.
You would like your parents to see a mark that is higher than or equal to
As of right now, you have predicted that for each test
Find out the minimum total number of hours you need to study for all tests. Note that each test is weighted the same.
Input Specification
Line
Lines
Output Specification
Output the minimum number of hours you need to study to get a mark of at least
Constraints
Subtasks
Subtask 1 [10%]
Subtask 2 [30%]
Subtask 3 [60%]
No additional constraints.
Sample Input
5 7 6
5 3
6 4
7 1
1 5
3 3
Sample Output
27
Sample Explanation
You can increase your score on the first test up to 7 by studying for 6 hours. You can then increase your score on the second test by 1 point with 4 hours of studying. You can increase your score on the fourth test by 1 point with 5 hours of studying. Finally, increase your score on the last test up to 7 by studying for 12 hours.
Note that you cannot increase your score on any test to have a value of greater than 7 as the tests are out of 7 marks.
Comments