Find the Maximum Value

All submissions for this problem are available.
Read problems statements in mandarin chinese, russian and vietnamese as well.
The Chef had a box with N numbers arranged inside it: A_{1}, A_{2}, ..., A_{N}. He also had the number N at the front, so that he knows how many numbers are in it. That is, the box actually contains N+1 numbers. But in his excitement due the ongoing IOI, he started dancing with the box in his pocket, and the N+1 numbers got jumbled up. So now, he no longer knows which of the N+1 numbers is N, and which the actual numbers are.
He wants to find the largest of the N numbers. Help him find this.
Input
 The first line of the input contains an integer T, denoting the number of test cases. The description of each testcase follows.
 Each of the next T lines will contain N and N numbers, but it is not guaranteed that N is the first number.
Output
For each test case, output a single line containing the maximum value of the N numbers in that testcase.
Constraints
 1 ≤ T ≤ 100
 1 ≤ N ≤ 50
 1 ≤ A_{i} ≤ 10^{9}
Example
Input: 3 1 2 1 3 1 2 8 1 5 1 4 3 2 Output: 1 8 4
Explanation
Test case 1:
N = 2 and the numbers are {1, 1}. The maximum among these 2 numbers is 1, and hence the output is 1.
Test case 2:
N = 3 and the numbers are {1, 2, 8}. The maximum among these 3 numbers is 8, and hence the output is 8.
Test case 3:
N = 5 and the numbers are {1, 1, 4, 3, 2}. The maximum among these 5 numbers is 4, and hence the output is 4.
Author:  arpa 
Editorial  https://discuss.codechef.com/problems/LOSTMAX 
Tags  arpa, cakewalk, ltime50 
Date Added:  28072017 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions