The Pharaoh's Greatest Tribute

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 64M

Authors:
Problem type

The 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 T — the number of test cases.
Each test case begins with an integer N (the number of chests), followed by N 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

1 \le T \le 100
1 \le N \le 10\,000
1 \le each value \le 1\,000\,000

Test cases available here!


Comments

There are no comments at the moment.