MINMAX - Reward for the hard work
You have successfully decrypted the exam paper and the miracle has happened! Owing to your generous nature, you decide to share this paper with your batch-mates. Just giving away the paper to everyone would belittle the pains you took to get it. So, you devise a strategy to earn reward for your hard work. You decide to meet your batch-mates by dividing them into separate groups of several different sizes. For each group, you give away the paper to the person who bids the highest amount.
Input
The first line of the input contains an integer g, the number of groups. After this, g lines follow. Each line starts with a single integer N, the number of batch-mates in the group followed by a space and than N space-separated integers bi, corresponding to the bids made by each of them.
Output
For each group, output one line containing "Group #x: a", where x is the group number (starting from 1), and a is the highest bid value.
Constraints
1 <= g <= 103
1 <= N <= 100
0 <= bi <= 109
Example
Input: 3 3 1 3 2
2 3 5 5 10 0 50 5 20 Output: Group #1: 3
Group #2: 5
Group #3: 50
Added by: | Siddharth Kothari |
Date: | 2010-09-26 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: NODEJS OBJC VB.NET |
Resource: | Own problem |