Student record
Submissions: 5347   Accuracy:


  Difficulty: Basic   Marks: 1

A file contains data as follows( Student name, marks in 3 subjects)
Shrikanth 20 50 60
Kiran 30 80 90
Find the student who has maximum average score.

The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is N,N is the number of student.
The second line of each test case contains N input Student name and marks in 3 subject.

Print the student name who has maximum average score and maximum average score(in int).

Note: If many students have the same average print the name of all these students in the same way as they appear in the input with space between each of the names and after that print the average marks.

1 ≤ T ≤ 10
1 ≤ N ≤ 15
1 ≤ s ≤ 10
1 ≤ marks ≤ 100

Shrikanth 20 30 10 Ram 100 50 10
Adam 50 10 40 Suresh 22 1 56 Rocky 100 90 10

Ram 53
Rocky 66

** For More Input/Output Examples Use 'Expected Output' option **

Author: rajatjha

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use, generate link and share the link here.

to report an issue on this page.