## SAC '21 P3 - DeMello's Replacement

View as PDF

Points: 5
Time limit: 1.0s
Memory limit: 256M

Authors:
Problem type

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

int(2.1) >> 2
math.floor(-2.1) >> -3