LCC/Moose '20 Contest 3 J3 - One-Trick Pony

View as PDF

Submit solution

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

Author:
Problem type

nicoella is playing her favourite champion, Zog! However, because nicoella is a one-trick, she is easily countered by her opponents with certain champions. Thankfully, nicoella is allowed to ban 1 opposing champion to maximize her own chance of winning. nicoella can check the most current statistics for the N champions in the game. She can see the relative winrate W_i of Zog against champion C_i, and its relative pickrate P_i.

More formally, a champion with a winrate W_x is \frac{W_x}{W_y} times more likely to lose to Zog than a champion with winrate W_y, and a champion with a pickrate P_x is \frac{P_x}{P_y} times more likely to be chosen than a champion with pickrate P_y.

Can you help nicoella maximize her chance to win?

Input Specification

The first line contains N\ (2 \le N \le 10^5), the number of bannable champions.

The next N lines contain a string and 2 integers C_i\ (1 \le |C_i| < 100), W_i\ (0 \le W_i \le 10^4), and P_i\ (0 \le P_i \le 10^7), the name, winrate, and pickrate of champion C_i.

It is guaranteed that every champion has a unique name of lowercase letters, that \Sigma P_i \le 10^7, and that P_i < \Sigma P_i for all i.

Output Specification

Print the name of the champion that nicoella should ban. If there are multiple, print the champion C_i with the smallest i. Note that 64-bit integers may be required to pass.

Subtasks

Subtask 1 [30%]

N \le 1000

Subtask 2 [70%]

No further constraints.

Sample Input

6
n 50 10
i 30 20
c 60 40
o 10 5
l 15 10
e 70 15

Sample Output

i

Comments

There are no comments at the moment.