Codeforces Round 994 (Div. 2) |
---|
Finished |
Evirir the dragon has many friends. They have 3 friends! That is one more than the average dragon.
You are given integers $$$n$$$, $$$x$$$, and $$$y$$$. There are $$$n$$$ dragons sitting in a circle. The dragons are numbered $$$1, 2, \ldots, n$$$. For each $$$i$$$ ($$$1 \le i \le n$$$), dragon $$$i$$$ is friends with dragon $$$i - 1$$$ and $$$i + 1$$$, where dragon $$$0$$$ is defined to be dragon $$$n$$$ and dragon $$$n + 1$$$ is defined to be dragon $$$1$$$. Additionally, dragons $$$x$$$ and $$$y$$$ are friends with each other (if they are already friends, this changes nothing). Note that all friendships are mutual.
Output $$$n$$$ non-negative integers $$$a_1, a_2, \ldots, a_n$$$ such that for each dragon $$$i$$$ ($$$1 \le i \le n$$$), the following holds:
$$$^{\text{∗}}$$$The minimum excluded (MEX) of a collection of integers $$$c_1, c_2, \ldots, c_m$$$ is defined as the smallest non-negative integer $$$t$$$ which does not occur in the collection $$$c$$$.
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 and only line of each test case contains three integers $$$n$$$, $$$x$$$, $$$y$$$ ($$$3 \le n \le 2 \cdot 10^5$$$, $$$1 \le x < y \le n$$$).
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output $$$n$$$ space-separated non-negative integers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) on a line that satisfy the condition in the statement. If there are multiple solutions, print any of them. It can be proven that under the problem constraints, a solution with $$$0 \le a_i \le 10^9$$$ always exists.
75 1 34 2 46 3 57 3 63 2 35 1 56 2 5
0 2 1 0 1 1 2 1 0 1 2 0 1 2 0 0 1 2 0 1 0 1 2 0 1 1 0 2 1 0 0 1 2 0 2 1
For the first test case:
Name |
---|