To reward good team determine to enter the world list of qualification for the finals at the same time, when two team to make the title of the number of phase at the same time, according to their use of time to further rankings, time has two parts, the first is the general problem solving time, 2 it is to punish, punish time refers to the penalty upon the presentation of the program did not pass the time, every time failed to submit, will increase in the final time for ranking for 20 minutes, for didn't solve the title not timing,
Your program will read in a list run results, and then print out the top three grades,
Enter
The input file contains several test data sets,
Each test data is composed of two parts, the first part contains a positive integer, it says the number of teams, the next few lines are the result of each submission, each said a submit results, including the time of submission, the team number, issue number and ruled as a result,
When the submit time a 0 in the line, said the current data set over, when the number of teams to 0, all indicates the end of the input,
The number of each test set team not more than 100, submit the number of not more than 10000 times,
O
For each set of input and output the score in the top three, including the team, to make the topic number, game, ranking, output at the top, to output "case n", where n what is the set of input current,
Assumption: there may be several teams in the same place, if there are several teams are the third, for example, will they all output; If there are two teams is second, then there is no third, when team places at the same time, according to the team number from small to large, output
Test cases
Enter
3
12 1 2 yes
14 3 no 2
25 March 1 yes
29 the no 1 1
38 3 2 yes
39 no 2 1
45 the no 1 1
0
0
O
Case 1:
3 2 1 83
1 1 12 2
2 0 0 3
CodePudding user response:
Too many words, lu, wan chunCodePudding user response:
This is not a c + + homework assignments