Logo
(追記) (追記ここまで)

34797번 - GPA Computation 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB120907373.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}$.

제한

예제 입력 1

5
A1
B2
C3
D1
E2

예제 출력 1

2.075

예제 입력 2

3
A3
E3
D3

예제 출력 2

1.6666666666666667

노트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2025 ICPC Pacific Northwest Regional > Division 2 C번

  • 문제를 만든 사람: Nick Wu
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /