LCC/Moose '20 Contest 1 J2 - Estimating Marks

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Nayaab finished her math test early (and checked her work multiple times), and now has a lot of time to spare. She knows that she might have gotten some questions wrong, or made some mistakes along the way, so she wants to try to calculate her mark on her test before it has been marked by the teacher. For each question, she is able to estimate the percentage she got correct, but she wants to know the estimated percentage of the entire test.

For example, on a 9 mark question, she may estimate that she got it 73 percent correct.

Can you help her estimate her total mark?

Input Specification

The first line will contain an integer N (2 \leq N \leq 500), the number of questions on the test.

The next N lines will contain two space-separated integers, M (1 \leq M \leq 20), the total number of marks for that question, and P (0 \leq P \leq 100), the fraction of the question that Nayaab expects to answer correctly, expressed as a percentage.

Output Specification

Output an integer, the estimated percentage of her test mark, rounded to the nearest integer.

Sample Input

5
8 79
19 100
2 21
5 48
6 97

Sample Output

85

Comments

There are no comments at the moment.