MWC '15 #3 P1: Challenger Promos

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

Over the course of D days, N players gain or lose Ti points on their base score Si. At the end of the D days, the top P players make it to the highest division which is called Challenger. Given players, their base scores, and their score change over D days, output the player with the Pth highest ranking (the last person to make it to Challenger).

Input Specification

The first line of input will contain one integer N (1N103), the numbers of players.
The next N lines of input will contain a string up to 30 characters long which is the name of each player and their base score Si (0Si106).
The next line of input will contain a single integer D (1D100), the number of days.
The next D×N lines contain the name of each player and the net change of each player's score Ti (SiTi106) on the Dith day.
The final line will contain one integer P, the number of players that will make it to Challenger.

Output Specification

Output a string, the name of the last player to make it to Challenger.

Sample Input

Copy
7
Hypnova 1000
Twisch 1304
Meruvale 1234
Ferina 976
Destryn 958
Intoxify 1062
Flaere 999
2
Hypnova -3
Twisch 2
Meruvale -3
Ferina 4
Destryn -1
Intoxify 3
Flaere 26
Hypnova 1003
Twisch -2
Meruvale 112
Ferina -13
Destryn 12
Intoxify -44
Flaere 34
3

Sample Output

Copy
Twisch

Comments

There are no comments at the moment.