#K41947. Sort Coffee Drinks by Hourly Earnings

    ID: 26978 Type: Default 1000ms 256MiB

Sort Coffee Drinks by Hourly Earnings

Sort Coffee Drinks by Hourly Earnings

You are given information about different coffee drinks. Each coffee drink is described by its name, the preparation time in minutes, and its selling price. The hourly earnings for a coffee drink are calculated by the formula $$E = \frac{60}{t} \times p$$ where (t) is the preparation time and (p) is the selling price. Your task is to sort the coffee drinks in descending order based on their hourly earnings. In case two drinks have the same hourly earnings, they should be sorted in lexicographical order by their names.

inputFormat

The first line of the input contains an integer (n) ( (1 \leq n \leq 10^5)) representing the number of coffee drinks. Each of the next (n) lines contains a coffee drink's information in the following format:

name preparation_time selling_price

where name is a non-empty string (without spaces), preparation_time and selling_price are integers.

outputFormat

Output the names of the coffee drinks in the sorted order. Each coffee drink name should be printed on a separate line.## sample

3
Latte 5 4
Espresso 2 3
Americano 4 2
Espresso

Latte Americano

</p>