Walter wants to buy a car
All submissions for this problem are available.
Walter white wants to buy a car, he does not care much about the type of car (sedan/hatchback/SUV) nor the power that the car has,
all he cares about is how much the car will cost him, since he has loads of money , he wants to buy the most expensive car available in the market, but there is a catch!
The tax percentages for each car vary and Walt wants to buy the most expensive car (including the tax costs), since there is a large selection of cars to choose from and he is busy 'cooking' for most of the time, he knocks on your door (because he is the one who knocks) one fine day and asks you to give him an efficient solution for his problem.
If two cars have the same cost after adding the tax costs, Walt wants the car which has higher base price.
Note: There is no case where the base price and interest rates of any two cars are the same
The first line of the input contains an integer T denoting the number of test cases.
Each line contains :N denoting the number of cars
The next N lines contain
- string S denoting the car name
- The cost of the car C
- The tax percentage to be paid for that particular car i
For each test case, output a single line containing the name of the car that you have to suggest for walter to buy
1 ≤ T ≤ 1000
1 ≤ N ≤ 100
1 ≤ S ≤ 20
100 ≤ C ≤ 1000000
0 ≤ i ≤ 100
Input: 2 3 Ferrari $100000 20% Porsche $200000 10% Lamborghini $300000 10% 2 BMW $20000 50% Benz $15000 100% Output: Lamborghini BMW
Example case 1. Lamborghini is the costliest car among the given cars
Example case 2. The two cars turn out to be the same cost after taxes, but the base price of BMW is more
|Time Limit:||0.1075 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions