#CCBOTPBA0000026. Experiments
Experiments
Experiments
Source: beecrowd
Version: Phuoc Hung OJ Extended
Problem Statement
Each of n experiments has an animal count and a type: C rabbits, R rats, S frogs. Sum totals and print the exact seven Portuguese lines with percentages to two decimals.
Input
First n, then exactly n pairs q c; 1 ≤ q ≤ 15, c is C, R or S.
Output
Print exactly seven Portuguese lines: Total: T cobaias; Total de coelhos: C; Total de ratos: R; Total de sapos: S; Percentual de coelhos: PC %; Percentual de ratos: PR %; Percentual de sapos: PS %. Percentages have two decimal digits and a space before %.
Subtasks
-
Subtask 1 (20%):
1 ≤ n ≤ 10; each quantity1..15. -
Subtask 2 (30%):
1 ≤ n ≤ 100; each quantity1..15. -
Subtask 3 (50%):
1 ≤ n ≤ 1000; each quantity1..15.
Examples
Example 1
Input:
3
10 C
5 R
5 S
Output:
Total: 20 cobaias
Total de coelhos: 10
Total de ratos: 5
Total de sapos: 5
Percentual de coelhos: 50.00 %
Percentual de ratos: 25.00 %
Percentual de sapos: 25.00 %
Explanation: There are 20 animals total; rabbits account for 50 percent and the other types 25 percent each.
Example 2
Input:
1
1 S
Output:
Total: 1 cobaias
Total de coelhos: 0
Total de ratos: 0
Total de sapos: 1
Percentual de coelhos: 0.00 %
Percentual de ratos: 0.00 %
Percentual de sapos: 100.00 %
Explanation: The single animal is a frog.