n-th Largest Value
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
You must write a program that prints the n-th largest value in a fixed sized array of integers. To make things simple, n will be 3 and the array will always be have 10 decimal integer values.
Input
The first line contains a single integer p (1 ≤ p ≤ 1000), which is the number of data sets that follow. Each data set consists of a single line containing the data set number, followed by a space, followed by 10 space separated decimal integers whose values are between 1 and 1000 inclusive.
Output
For each data set generate one line with the following values: The data set number as a decimal integer, a space, and the 3-rd largest value of the corresponding 10 integers.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 49%