BESTMARK - Best Students

no tags 

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

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.

Output

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.

Example

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.


hide comments
ks1999: 2017-03-01 22:10:15

Where can i apply for that contest

stcsteven: 2016-04-10 06:53:25

AC in second try ._.

nishkarshl: 2016-04-07 16:06:25

give any testcase

Last edit: 2016-04-07 16:17:25

Added by:imranziad
Date:2016-04-07
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 GOSU JS-MONKEY
Resource:Imran Ziad (ACC Beginners Contest)