| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 120 | 90 | 73 | 73.737% |
Lydia wants to know if she is valedictorian!
Lydia's school computes the grade point averages of its students as follows - for each class that a student takes, they get assigned a letter grade from A to E. An A is worth 4 points, a B is worth 3 points, a C is worth 2 points, a D is worth 1 point, and an E is worth no points. The unweighted grade point average is therefore derived by computing the sum of these point values and dividing by the number of classes Lydia took.
To compute the weighted grade point average, each of the classes is assigned a tier from 1 to 3. If a student gets an A, B, or C in a tier 1 class, they get an additive bonus of 0.05 points. If a student gets an A, B, or C in a tier 2 class, they get an additive bonus of 0.025 points. These are the only ways to get additive bonuses. The weighted grade point average is computed by adding together all the additive bonuses to the unweighted grade point average.
Given Lydia's transcript, compute her weighted grade point average!
The first line of input contains a single integer, $n$ (1ドル \le n \le 50$).
Each of the next $n$ lines contains a two-character string, the letter grade for one of the classes Lydia took followed by the tier of the class. It is guaranteed the first character will be in ABCDE and the second character will be in 123.
Output a single number, Lydia's weighted grade point average. Your answer will be considered correct if it has absolute or relative error at most 10ドル^{-6}$.
5 A1 B2 C3 D1 E2
2.075
3 A3 E3 D3
1.6666666666666667
ICPC > Regionals > North America > Pacific Northwest Regional > 2025 ICPC Pacific Northwest Regional > Division 2 C번