Kevin has $$$n$$$ sticks with length $$$a_1,a_2,\ldots,a_n$$$.
Kevin wants to select $$$4$$$ sticks from these to form an isosceles trapezoid$$$^{\text{∗}}$$$ with a positive area. Note that rectangles and squares are also considered isosceles trapezoids. Help Kevin find a solution. If no solution exists, output $$$-1$$$.
$$$^{\text{∗}}$$$An isosceles trapezoid is a convex quadrilateral with a line of symmetry bisecting one pair of opposite sides. In any isosceles trapezoid, two opposite sides (the bases) are parallel, and the two other sides (the legs) are of equal length.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 2\cdot 10^5$$$).
The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 10^8$$$).
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\cdot 10^5$$$.
For each test case, output $$$4$$$ integers — the lengths of sticks. If no solution exists, output $$$-1$$$.
If there are multiple solutions, print any of them.
745 5 5 10410 5 10 541 2 3 441 1 1 364 2 1 5 7 1610 200 30 300 30 1004100000000 100000000 1 2
5 5 5 10 5 5 10 10 -1 -1 1 1 4 5 -1 100000000 100000000 1 2
In the first test case, you can form an isosceles trapezoid with bases of length $$$5$$$ and $$$10$$$, and two legs of length $$$5$$$.
In the second test case, you can form an isosceles trapezoid with two bases of length $$$5$$$ and two legs of length $$$10$$$. A rectangle is considered an isosceles trapezoid here.
In the third test case, there are no sticks with the same length. It's impossible to form an isosceles trapezoid.
In the fourth test case, it's impossible to form an isosceles trapezoid with a positive area.
Name |
---|