欢迎光临散文网 会员登陆 & 注册

CF 1790B - Taisia and Dice

2023-07-18 13:56 作者:您是打尖儿还是住店呢  | 我要投稿

Taisia has n six-sided dice. Each face of the die is marked with a number from 1 to 6, each number from 1 to 6 is used once.


Taisia rolls all n dice at the same time and gets a sequence of values a1,a2,…,an (1≤ai≤6), where ai is the value on the upper face of the i-th dice. The sum of this sequence is equal to s.


Suddenly, Taisia's pet cat steals exactly one dice with maximum value ai and calculates the sum of the values on the remaining n−1 dice, which is equal to r.

You only know the number of dice n and the values of s, r. Restore a possible sequence a that fulfills the constraints.

Input

The first line contains the integer t (1≤t≤1000) — the number of testcases.

Each testcase is given on a separate line and contains three integers n, s, r (2≤n≤50, 1≤r<s≤300).

It is guaranteed that a solution exists.


Output

For each testcase, print: n integers a1,a2,…,an in any order. It is guaranteed that such sequence exists.


If there are multiple solutions, print any.

Example

----------------------------------------------

Taisia 有 n 个六面骰子。 骰子的每个面都标有1到6的数字,1到6的每个数字只能使用一次。


Taisia 同时掷所有 n 个骰子,得到一系列值 a1,a2,…,an (1≤ai≤6),其中 ai 是第 i 个骰子上表面的值。 该序列的总和等于 s。


突然,泰西亚的宠物猫恰好偷走了一颗具有最大值 ai 的骰子,并计算了剩余 n−1 个骰子的值之和,等于 r。

你只知道骰子的个数n和s、r的值。 恢复满足约束的可能序列a。

输入

第一行包含整数 t (1≤t≤1000) — 测试用例的数量。

每个测试用例都在单独的行上给出,并包含三个整数 n、s、r(2≤n≤50、1≤r<s≤300)。

保证存在解。


输出

对于每个测试用例,打印:n 个整数 a1,a2,…,an(按任意顺序)。 保证这样的序列存在。


如果有多个解决方案,请打印其中一个。

例子

--------------------------------------------

计算平均值,保留余数,每次都用平均数+1,然后余数--,直到余数为0;

输出即可;

下面是代码:


CF 1790B - Taisia and Dice的评论 (共 条)

分享到微博请遵守国家法律