ICPC Regional contest results are determined by the final team standings after a regional contest. A regional contest consists of some number of problems that are to be solved by some number of team
ICPC Regional contest results are determined by the final team standings after a regional contest. A regional contest consists of some number of problems that are to be solved by some number of teams. Teams are ranked according to the most problems solved. Teams who solve the same number of problems are ranked by least total time. The total time is the sum of the time consumed for each problem solved. The time consumed for a solved problem is the time elapsed from the beginning of the contest to the submittal of the first accepted run plus 20 penalty minutes for every previously rejected run for that problem. There is no time consumed for a problem that is not solved. In the event of ties, the team with the smaller time consumed of the last correctly submitted solution ranks higher. That process is repeated as needed (2nd to last correctly submitted problem, 3rd to last correctly submitted problem, etc.) If there is still a tie after all tie-breakers have been exhausted, the teams are ranked equally and displayed in team number order. For example, if there are 3 teams in a contest, and teams 1 and 3 both rank 1, then team 2 would be rank 3 (there is no rank 2 in this case). For this problem you will write a program to print the final standings of a contest based on the supplied input.