Third Largest Number
InterviewTime limit1sMemory limit32 MB
For each test case of 10 positive integers, output the third largest distinct-position value in the array.
Problem
Given an array A, write a program that prints the third largest value in the array.
The size of A is always 10, and every element is a positive integer. The requested rank is always 3.
Input
The first line contains the number of test cases T (1 ≤ T ≤ 1,000). Each test case is given on one line and contains 10 elements of array A separated by spaces. Each element is a positive integer from 1 to 1,000 inclusive.
Output
For each test case, print the third largest value in array A on its own line.