#K75592. Calculate Final Grade

    ID: 34453 Type: Default 1000ms 256MiB

Calculate Final Grade

Calculate Final Grade

You are given a list of assignments. Each assignment has a score and a weight (in percentage). The final grade is calculated as the weighted average of these scores and then rounded up to the nearest integer.

Formally, if there are n assignments with scores \(s_i\) and weights \(w_i\), the final grade is computed as:

\( \text{Final Grade} = \lceil \sum_{i=1}^{n} \frac{s_i \times w_i}{100} \rceil \)

Your task is to implement a program that reads the list of assignments from standard input and outputs the final grade to standard output.

inputFormat

The input is read from standard input in the following format:

  • The first line contains an integer \(N\), the number of assignments.
  • The following \(N\) lines each contain two numbers representing the score and the weight of an assignment, separated by space. The score can be a floating-point number, and the weight is given as a percentage.

outputFormat

Output to standard output a single integer: the final grade after calculating the weighted average of the scores and rounding up to the nearest whole number.

## sample
2
90 40
80 60
84