3102: Interesting Running

时间限制:1000 ms 内存限制:128 MB
Special Judge 上传者:
提交:60 通过:13

题目描述

There are many diligent students living in the joyful Rainbow Island, They study hard every day. In order to encourage students to participate in sports, Rainbow launches a new activity, each student participating in this activity must complete a running task. That is, running on a linear coordinate axis, each student participating in the activity will generate $n$ check-in points position $p_{1},p_{2},..., p_{n}$ , according to their initial position $x$, and these points are all on this one-dimensional coordinate axis. Students need to punch all the check-in points position while running.

Bob participated in this activity. He likes to choose the nearest point among the remaining non clocked points every time he reaches a clocking point. Please help find the order of the check-in points position that Bob passes during his run.

输入格式

The first line contains a single integer $T (T \le 10)$ — the number of samples.

The first line of each test case contains two integers $n, x$ $ (1 \le n  \le 10^{5}, 1 \le x \le 10^9)$ —the number of the check-in points, the initial position.

Next line contains n integer $ p_{1},p_{2},...,p_{n} (p_{i} \le 10^{9}) $   — position of each check-in point.

输出格式

For each test case, print $n + 1$ numbers — indicating the sequence of Bob's movement. 

This sequence starts from the initial point, and then there are n check-in point's position. The order in which Bob is clocked in. 

If there are several possible answers, you can print any of them.

输入样例 复制

1
2 2
1 3

输出样例 复制

2 1 3