CF1733B.Rule of League

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

There is a badminton championship in which nn players take part. The players are numbered from 11 to nn .

The championship proceeds as follows: player 11 and player 22 play a game, then the winner and player 33 play a game, and then the winner and player 44 play a game, and so on. So, n1n-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 xx games or yy games in the championship.

Given nn , xx , and yy , find out if there is a result that matches this information.

输入格式

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

The only line of each test case contains three integers nn , xx , yy ( 2n1052 \le n \le 10^5 , 0x,y<n0 \le x, y < n ).

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

输出格式

Print the answer for each test case, one per line. If there is no result that matches the given information about nn , xx , yy , print 1-1 . Otherwise, print n1n-1 space separated integers, where the ii -th integer is the player number of the winner of the ii -th game.

If there are multiple valid results, print any.

输入输出样例

  • 输入#1

    5
    5 2 0
    8 1 2
    3 0 0
    2 0 1
    6 3 0

    输出#1

    1 1 4 4
    -1
    -1
    2 
    -1

说明/提示

In the first test case, player 11 and player 44 won xx times, player 22 and player 33 won yy times.

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

首页