Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Input - A 3 B 4 A 1 A 1
- Output - 3.56
- Explanation: (4.0 * 3 + 3.0 * 4 + 4.0 * 1 + 4.0 * 1)/(3+4+1+1) = 3.555556 rounded off to 3.57
- Input - A 4 F 2 C 3 D 4
- Output - 2.23
- Explanation: (4.0 * 4 + 0.0 * 2 + 2.0 * 3 + 1.0 * 4)/(4+2+3+4) = 3 rounded off to 3.00
Add Comment
Please, Sign In to add comment