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 T_i points on their base score S_i. 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 P^{th} highest ranking (the last person to make it to Challenger).

Input Specification

The first line of input will contain one integer N (1 \le N \le 10^3), 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 S_i (0 \le S_i \le 10^6).
The next line of input will contain a single integer D (1 \le D \le 100), the number of days.
The next D \times N lines contain the name of each player and the net change of each player's score T_i (-S_i \le T_i \le 10^6) on the {D_i}^{th} 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

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

Twisch

Comments

There are no comments at the moment.