最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網 會員登陸 & 注冊

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的數(shù)字,1到6的每個數(shù)字只能使用一次。


Taisia 同時擲所有 n 個骰子,得到一系列值 a1,a2,…,an (1≤ai≤6),其中 ai 是第 i 個骰子上表面的值。 該序列的總和等于 s。


突然,泰西亞的寵物貓恰好偷走了一顆具有最大值 ai 的骰子,并計算了剩余 n?1 個骰子的值之和,等于 r。

你只知道骰子的個數(shù)n和s、r的值。 恢復滿足約束的可能序列a。

輸入

第一行包含整數(shù) t (1≤t≤1000) — 測試用例的數(shù)量。

每個測試用例都在單獨的行上給出,并包含三個整數(shù) n、s、r(2≤n≤50、1≤r<s≤300)。

保證存在解。


輸出

對于每個測試用例,打?。簄 個整數(shù) a1,a2,…,an(按任意順序)。 保證這樣的序列存在。


如果有多個解決方案,請打印其中一個。

例子

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

計算平均值,保留余數(shù),每次都用平均數(shù)+1,然后余數(shù)--,直到余數(shù)為0;

輸出即可;

下面是代碼:


CF 1790B - Taisia and Dice的評論 (共 條)

分享到微博請遵守國家法律
东阳市| 南漳县| 延边| 托克托县| 宝清县| 鄂尔多斯市| 綦江县| 察雅县| 沂源县| 嘉定区| 株洲县| 莱芜市| 眉山市| 阜南县| 定陶县| 曲阳县| 商南县| 上栗县| 西平县| 淮安市| 红河县| 雷山县| 历史| 佛山市| 枝江市| 清远市| 呼图壁县| 永定县| 玉龙| 大悟县| 平江县| 西峡县| 阿拉善右旗| 清水县| 龙州县| 鄂尔多斯市| 门源| 江西省| 临洮县| 阿克陶县| 中宁县|