#K74087. Sum of Two Smallest Stone Identifiers
Sum of Two Smallest Stone Identifiers
Sum of Two Smallest Stone Identifiers
You are given a number of test cases. In each test case, you have a list of stone identifiers. Your task is to find and output the sum of the two smallest identifiers in each test case.
The input starts with an integer T, representing the number of test cases. For each test case, the first line contains an integer K indicating the number of stones, followed by a line of K space-separated integers representing their identifiers. Your program should output the sum of the two smallest numbers for each test case on a separate line.
Note: All input values are integers and negative values may also appear.
Mathematically, if the sorted list of stone identifiers in a test case is \(a_1 \le a_2 \le \dots \le a_K\), then you must output \(a_1 + a_2\).
inputFormat
The input is given via standard input (stdin) and has the following format:
T K a1 a2 ... aK K a1 a2 ... aK ...
Where T is the number of test cases, and for each test case, K denotes the number of stone identifiers followed by a line of K space-separated integers.
outputFormat
For each test case, output a single line containing one integer, which is the sum of the two smallest stone identifiers.
## sample3
5
7 3 5 1 9
4
6 2 4 8
6
10 3 6 1 7 2
4
6
3
</p>