Problem K
Einkunnir
Languages
en
is
Karen has to review the multiple choice exams some students turned in. For each question there is exactly one correct answer. Each question is worth equally much in terms of the grade and there is no penalty for wrong answers. Karen doesn’t enjoy going over this by hand and has thus made a little program where the students mark a cross in each question. The program is designed so that you can not turn in the exam unless exactly one cross is marked in each question. Help Karen calculate the grades.
Input
On the first line there are two integers $S$ and $N$ denoting the number of questions on the exam and the number of students. On the next line the answer key is given, upper case letters from A to Z separated by spaces, where for example A D E means the answers to questions $1$, $2$ and $3$ on a three question exam are A, D and E in that order. Then there are $2N$ lines giving the student submissions. First there is a line with the student’s name, the length of the name is at most $20$ characters, and then a line with the student’s answers in the same format as the answer key.
Output
Output one line for each student containing their name and their grade. The grades are on the scale from $0$ to $10$ and they should be printed in the same order as they are given in the input. Grades are given as either whole numbers or a whole number plus a half, given with exactly one trailing digit. Grades are rounded up on values equally far from two possible values, e.g. $8.25$ would be rounded to $8.5$ but $7.24$ would be rounded to $7$.
Scoring
Group |
Points |
Constraints |
1 |
100 |
$1 \leq S \leq 5 \cdot 10^3, 1 \leq N \leq 100$ |
Sample Input 1 | Sample Output 1 |
---|---|
5 3 C C C C B Valdi C C C C B Arnkell C C C C A Emma C C B B A |
Valdi: 10.0 Arnkell: 8.0 Emma: 4.0 |
Sample Input 2 | Sample Output 2 |
---|---|
10 5 C A C D B C C A D C Gunnar C C B C D A A C D D Agla C A C D B C C A D C Abela A A D A D A C A B C Herluf C A B D C C C D D A Britt C C D D A C C D C C |
Gunnar: 2.0 Agla: 10.0 Abela: 4.0 Herluf: 6.0 Britt: 5.0 |