zoj 2970

来源:互联网 发布:phpstorm mac 编辑:程序博客网 时间:2024/05/09 11:05
Faster, Higher, Stronger
Time Limit: 1 Second      Memory Limit: 32768 KB

In the year 2008, the 29th Olympic Games will be held in Beijing. This will signify the prosperity of China and Beijing Olympics is to be a festival for people all over the world as well.

The motto of Olympic Games is "Citius, Altius, Fortius", which means "Faster, Higher, Stronger".

In this problem, there are some records in the Olympic Games. Your task is to find out which one is faster, which one is higher and which one is stronger.

Input

Standard input will contain multiple test cases. The first line of the input is a single integer T (1 <= T <= 50) which is the number of test cases. And it will be followed by T consecutive test cases.

Each test case has 3 lines. The first line is the type of the records, which can only be "Faster" "Higher" or "Stronger". The second line is a positive integer N meaning the number of the records in this test case. The third line has N positive integers, i.e. the records data. All the integers in this problem are smaller than 2008.

Output

Results should be directed to standard output. The output of each test case should be a single integer in one line. If the type is "Faster", the records are time records and you should output the fastest one. If the type is "Higher", the records are length records. You should output the highest one. And if the type is "Stronger", the records are weight records. You should output the strongest one.

Sample Input

 

3Faster310 11 12Higher43 5 4 2Stronger2200 200

 

Sample Output

 

105200
 
原创粉丝点击