Zeyu is making his first ever Sadness Contest! His contest consists of
The rules of his contests are as follows:
- The contest lasts for
minutes. - Each contestant may submit at most
times to each problem. - Contestants are ordered by the number of problems solved. The more problems they solved, the better their rank.
- If there is a tie in the number of problems solved, then contestants are ordered by the sum of the times used to solve the problems (in minutes) starting from the beginning of the contest, plus
minutes for each incorrect submission to a problem they solved. Note that there is no penalty for incorrect submissions to a problem that they did not solve. The smaller their sum of times plus penalty, the better their rank. - If there is also a tie in the sum of times plus penalty, then the contestants are ordered by their identification number. The smaller their identification number, the better their rank.
You have been given a list of all
It is guaranteed that no contestant submitted an incorrect submission to a problem they already solved and that no two contestants had an accepted submission in the same minute. It is also guaranteed that a valid scoreboard can be recreated from the partial submission list.
Constraints
For this problem, you will NOT be required to pass all the samples in order to receive points. In addition, all subtasks are disjoint, and you are NOT required to pass previous subtasks to earn points for a specific subtask.
Subtask 1 [10%]
Subtask 2 [20%]
Subtask 3 [20%]
Subtask 4 [50%]
No additional constraints.
Input Specification
The first line contains
The next
Output Specification
Output
The
- The first string should be an integer
in the range representing the identification number of the contest who was rank at the end of the contest. - The next
strings describe the submissions the contestant made. The of these strings should be in the form<time>/<penalty>
.<time>
is an integer in the range representing the time in minutes that the contestant submitted to the problem.<penalty>
is an integer in the range representing the number of incorrect submissions that the contestant made to the problem. If the contestant did not solve the problem, then the string should be-/-
instead of the format described. Note that all accepted submission times must be unique.
Note that for this problem, a verdict involving Presentation Error indicates that your output format is incorrect or the output does not represent a valid scoreboard, (including, but not limited to not outputting the contestants in the order of their final rank).
Sample Input 1
3 1 2
3 1 1
1 1 1
Sample Output 1
1 10/0
3 1/5
2 -/-
Sample Explanation 1
After the first accepted submission at
Sample Input 2
2 3 6
2 2 1
1 3 1
1 2 1
2 1 2
1 1 1
2 3 1
Sample Output 2
2 45/3 8/1 67/3
1 59/6 22/5 18/0
Sample Explanation 2
Note that after the first two submissions, there is a tie in the sum of submission times plus penalties. Since contestant
Comments