Mr. DeMello wants to find a replacement for himself before retiring. He has determined how to score them and uses the equation , where is the student's math grade, is the student's computer science grade, is the student's English grade, and is an integer of Mr. DeMello's choice. Given students, Mr. DeMello wants you to determine the student with the highest score and the student with the lowest score rounded down to the closest integer.
Input Specification
The first line will consist of a positive integer and .
The next lines will consist of the name of the student (with no spaces between characters) and their math , computer science , and English mark separated by a space.
Note: The maximum and minimum scores will be distinct from every other score (even after rounding down), and and will not both be .
Output Specification
On the first line of output, output the name of the student with the highest score followed by their score , separated by a space and rounded down to the closest integer.
On the second line of output, output the name of the student with the lowest score followed by their score , separated by a space and rounded down to the closest integer.
Sample Input
3 2
Zain 98 99 96
Max 92 100 2
Ethan 34 57 58
Sample Output
Max 30030
Ethan 9538
Comments
Note that directly using int to floor will cause the float to be rounded towards 0.(At least for me in python) In other words,
This caused me to be stuck in the contest trying different ways of changing the equation to some form... :( At least I learned a lesson today