Problem C
Space Race

Anthony and his friends have been arguing among themselves on who has the better space-car. They decided to settle on having a competition on an alien planet to finally settle who has the best space-car. This alien planet is unique as it has no atmosphere, thereby removing air resistance, and the barren land also removes the friction on the car, making it perfect for a space race! To decide this, they need you to make a program which calculates the most efficient space-car. To do this they have given you two formulas!

The rate of fuel is equal to the fuel consumed divided by the time taken. The efficiency is equal to the velocity divided by the rate of fuel.

The winner is decided by the highest efficiency. Anthony and his friends are counting on you!!


The first line of input will contain $n$, where $n$ is the number of space-cars ($2 \leq n \leq 15$). The second line of input will contain $d$, where $d$ is an decimal distance amount from start to end ($2000 \leq d \leq 9999$). The next $n$ lines of input will contain the unique initials of the racer (2 uppercase letters), followed by a decimal $v$ which represents the velocity of the ship ($100 \leq v \leq 999$), which is also followed by a decimal $r$ that represents the fuel consumed ($100 \leq r \leq 999$). All decimals have at most four digits after the decimal point.


The output should be one line which is the initials of the racer with the most efficient space-car. It is guaranteed that there is only one winner.

Sample Input 1 Sample Output 1
AB 400 320
BC 500 160
AL 100 500
Sample Input 2 Sample Output 2
EL 320 100
AR 300 200.25
RB 520 700
YU 420 800
WR 320 120

Please log in to submit a solution to this problem

Log in