Codeforces Round 821 (Div. 2)
B
Rule of League
Codeforces
900
原题
← AC →
翻译中…

There is a badminton championship in which $n$ players take part. The players are numbered from $1$ to $n$.

翻译中…

The championship proceeds as follows: player $1$ and player $2$ play a game, then the winner and player $3$ play a game, and then the winner and player $4$ play a game, and so on. So, $n-1$ games are played, and the winner of the last game becomes the champion. There are no draws in the games.

翻译中…

You want to find out the result of championship. Currently, you only know the following information:

翻译中…
  • Each player has either won $x$ games or $y$ games in the championship.
翻译中…

Given $n$, $x$, and $y$, find out if there is a result that matches this information.

翻译中…

Input

翻译中…

The first line contains one integer $t$ ($1 \le t \le 10^5$) — the number of test cases.

翻译中…

The only line of each test case contains three integers $n$, $x$, $y$ ($2 \le n \le 10^5$, $0 \le x, y \lt n$).

翻译中…

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2 \cdot 10^5$.

翻译中…

Output

翻译中…

Print the answer for each test case, one per line. If there is no result that matches the given information about $n$, $x$, $y$, print $-1$. Otherwise, print $n-1$ space separated integers, where the $i$-th integer is the player number of the winner of the $i$-th game.

翻译中…

If there are multiple valid results, print any.

翻译中…

Note

翻译中…

In the first test case, player $1$ and player $4$ won $x$ times, player $2$ and player $3$ won $y$ times.

翻译中…

In the second, third, and fifth test cases, no valid result exists.

翻译中…

样例

Input #1
5
5 2 0
8 1 2
3 0 0
2 0 1
6 3 0
Output #1
1 1 4 4
-1
-1
2
-1
InputCopy OutputCopy
题目信息
题号
1733B
时间限制
2 s
内存限制
256 MB
标签
构造
数学

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