The Pharaoh's Greatest Tribute
View as PDFThe Pharaoh's Greatest Tribute
Every year, the provinces of Egypt send tribute to Pharaoh Ramses. Each province delivers a chest filled with a certain number of gold coins.
The Royal Treasurer lines all the chests in a row and must announce the largest tribute to the court.
Your Task
Given an array of N positive integers representing gold coin counts, output the maximum value in the array.
Input Specification
The first line contains an integer — the number of test cases.
Each test case begins with an integer (the number of chests), followed by
space-separated integers on the same or next line.
Output Specification
For each test case print one line containing the maximum value.
Sample Input
3
6
10 45 23 67 12 89
4
5 5 5 5
1
42
Sample Output
89
5
42
Constraints
Comments