IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + Div. 2)
B
Kevin and Geometry
Codeforces
1100
原题
← AC →
翻译中…

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.

翻译中…

Input

翻译中…

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$.

翻译中…

Output

翻译中…

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.

翻译中…

Note

翻译中…

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.

翻译中…

样例

Input #1
7
4
5 5 5 10
4
10 5 10 5
4
1 2 3 4
4
1 1 1 3
6
4 2 1 5 7 1
6
10 200 30 300 30 100
4
100000000 100000000 1 2
Output #1
5 5 5 10
5 5 10 10
-1
-1
1 1 4 5
-1
100000000 100000000 1 2
InputCopy OutputCopy
题目信息
题号
2061B
时间限制
1 s
内存限制
256 MB
标签
二分
计算几何

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。