Codeforces Round 1008 (Div. 2)
C
Breach of Faith
Codeforces
未评级
原题
← BD →
翻译中…

You and your team have worked tirelessly until you have a sequence $a_1, a_2, \ldots, a_{2n+1}$ of positive integers satisfying these properties.

翻译中…
  • $1 \le a_i \le 10^{18}$ for all $1 \le i \le 2n + 1$.
  • $a_1, a_2, \ldots, a_{2n+1}$ are pairwise distinct.
  • $a_1 = a_2 - a_3 + a_4 - a_5 + \ldots + a_{2n} - a_{2n+1}$.
翻译中…

However, the people you worked with sabotaged you because they wanted to publish this sequence first. They deleted one number from this sequence and shuffled the rest, leaving you with a sequence $b_1, b_2, \ldots, b_{2n}$. You have forgotten the sequence $a$ and want to find a way to recover it.

翻译中…

If there are many possible sequences, you can output any of them. It can be proven under the constraints of the problem that at least one sequence $a$ exists.

翻译中…

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 one integer $n$ ($1 \leq n \leq 2 \cdot 10^5$).

翻译中…

The second line of each test case contains $2n$ distinct integers $b_1, b_2, \ldots, b_{2n}$ ($1 \leq b_i \leq 10^9$), denoting the sequence $b$.

翻译中…

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 $2n+1$ distinct integers, denoting the sequence $a$ ($1 \leq a_i \leq 10^{18}$).

翻译中…

If there are multiple possible sequences, you can output any of them. The sequence $a$ should satisfy the given conditions, and it should be possible to obtain $b$ after deleting one element from $a$ and shuffling the remaining elements.

翻译中…

样例

Input #1
4
1
9 2
2
8 6 1 4
3
99 2 86 33 14 77
2
1 6 3 2
Output #1
7 9 2
1 8 4 6 9
86 99 2 77 69 14 33
4 6 1 2 3
InputCopy OutputCopy
题目信息
题号
2078C
时间限制
2 s
内存限制
256 MB

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