BESTMARK - Best Students
Quiz marks are very important for good grades. In AIUB most of the courses have 3 quizzes in every term. Professor X is very serious about these quizzes. In his class there are N students and all of them have to attend these 3 quizzes to pass the semester. Each quiz contains 20 marks. Now after the mid-term Professor X. sums up each student’s total quiz marks to find the best students in the class. As you are his ex-best student he asked your help to write a program to make this process faster.
You are given N students quiz marks. Calculate each student’s total marks and find the highest mark among them. Also how many students got that mark.
Input starts with an integer T (≤ 50), denoting the number of test cases.
Each case starts with an integer N (1 ≤ N ≤ 100) denoting the number of students. Next N lines contain 3 integers each q1 q2 q3 (0 ≤ q1, q2, q3 ≤ 20). The ith line denotes the quiz marks of the ith student.
For each test case print two integers H and S. H is the highest mark of the best student and S is the number of students who got H marks.
Input: 2 3 10 12 15 12 12 15 15 10 15 2 5 7 9 1 15 5
Output: 40 1 21 2
P.S. Contest is going on. Problem will be moved to tutorial section after the contest.
Where can i apply for that contest
AC in second try ._.
give any testcaseLast edit: 2016-04-07 16:17:25