Now that Fardin has bought his presents, he must distribute them amongst his teachers. However, he is doing well with some teachers and poorly with some others. Fardin has bought
Input Specification
Line 1: one integer,
Line 2: one integer,
The next
- Present name
- Present price (Given to 2 decimal places)
The next
- Teacher name
- Teacher rating (Given as an integer)
Note: The input may contain spaces, punctuation, lowercase and uppercase letters.
Output Specification
The teacher and the present they get in ascending order of Fardin's unique rating of them.
Sample Input
4
4
Compact Disc
2.50
Science Textbook
41.50
Chocolate Bar
0.99
Blu-ray Player
25.98
Mr. Nikoletos
93
Ms. Brown
90
Mr. Fong
92
Mr. Wilson
95
Sample Output
Ms. Brown will get a Chocolate Bar
Mr. Fong will get a Compact Disc
Mr. Nikoletos will get a Blu-ray Player
Mr. Wilson will get a Science Textbook
Explanation
Fardin loves Mr. Wilson the most, thus he gets the most expensive present, the Science Textbook. Next is Mr. Nikoletos, so he'll get the second most expensive present, the Blu-ray player, and so on (Why is a textbook more expensive than a Blu-ray player?). We output these in reverse as required by the problem statement.
Comments
Can someone check over my submission to see why I'm failing the last test case? Pretty much tried everything but I'm still wondering why my output is being truncated.