12758 - Scoreboard Parsing (cont'd)   

Description

Calculate the score of students from the NTHU OJ scoreboard based on how many test cases a student has passed.

This is a continued problem from Problem 12731. (https://acm.cs.nthu.edu.tw/problem/12731/)

Input

Multiple lines of score information, where each line is an answering record for a user account.

Now the number of questions for a contest could have more than 1.

First line is the weight for each question.

Weight_for_problem_1  Weight_for_problem_2  ...  Weight_for_problem_N

The format of each line after line 1 is given as: 

Rank, User, Problem 1 Result, Problem 2 Result, ... , Problem N Result, Total Passed Cases

Examples are shown below.

1,GEC2_105071035,3\3,2\5, ...,0\1,12

The 3\3 of Answering Result denotes passed_cases\total_cases of a problem.

 

The score of a question is calculated as the number of passed test cases divided by the total number of test cases within a question.

The score of a student is calculated as the weighted average score of all questions.

In case one doesn't understand the definition of the weighted average, the formula is also provided below.

weighted average

Output

The score for each student of the given contest with the format:

User,Score

Note that

  1. The order of the output score should follow the same order of the input.
  2. The score should have 2 decimals.

Sample Input  Download

Sample Output  Download

Tags




Discuss