310153: CF1790B. Taisia and Dice

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Taisia and Dice

题意翻译

- 有 $n$ 个六面骰子,其中第 $i$ 个骰子的点数为 $a_i$,这 $n$ 个骰子的点数之和为 $s$。 - 拿走一个点数最大的骰子,剩余 $n-1$ 个骰子的点数之和为 $r$。 - 给定 $n, s, r$,请输出任意一个可能的序列 $a$。 - 本题有 $t$ 组数据,每组数据一行,即 $n, s, r$ 的值。 - $1\le t\le 1000, 2\le n \le 50, 1\le a_i\le 6, 1\le r < s \le 300$。 翻译提供者@\_\_Allen\_123\_\_

题目描述

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 $ a_1, a_2, \ldots, a_n $ ( $ 1 \le a_i \le 6 $ ), where $ a_i $ 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 $ a_i $ 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.

输入输出格式

输入格式


The first line contains the integer $ t $ ( $ 1 \le t \le 1000 $ ) — the number of testcases. Each testcase is given on a separate line and contains three integers $ n $ , $ s $ , $ r $ ( $ 2 \le n \le 50 $ , $ 1 \le r < s \le 300 $ ). It is guaranteed that a solution exists.

输出格式


For each testcase, print: $ n $ integers $ a_1, a_2, \ldots, a_n $ in any order. It is guaranteed that such sequence exists. If there are multiple solutions, print any.

输入输出样例

输入样例 #1

7
2 2 1
2 4 2
4 9 5
5 17 11
3 15 10
4 4 3
5 20 15

输出样例 #1

1 1
2 2 
1 2 2 4
6 4 2 3 2
5 5 5
1 1 1 1
1 4 5 5 5

Input

题意翻译

- 有 $n$ 个六面骰子,其中第 $i$ 个骰子的点数为 $a_i$,这 $n$ 个骰子的点数之和为 $s$。 - 拿走一个点数最大的骰子,剩余 $n-1$ 个骰子的点数之和为 $r$。 - 给定 $n, s, r$,请输出任意一个可能的序列 $a$。 - 本题有 $t$ 组数据,每组数据一行,即 $n, s, r$ 的值。 - $1\le t\le 1000, 2\le n \le 50, 1\le a_i\le 6, 1\le r < s \le 300$。 翻译提供者@\_\_Allen\_123\_\_

Output

**题意翻译**

- 有 $ n $ 个六面骰子,其中第 $ i $ 个骰子的点数为 $ a_i $,这 $ n $ 个骰子的点数之和为 $ s $。
- 拿走一个点数最大的骰子,剩余 $ n-1 $ 个骰子的点数之和为 $ r $。
- 给定 $ n, s, r $,请输出任意一个可能的序列 $ a $。
- 本题有 $ t $ 组数据,每组数据一行,即 $ n, s, r $ 的值。
- $ 1\le t\le 1000, 2\le n \le 50, 1\le a_i\le 6, 1\le r < s \le 300 $。

**题目描述**

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

Taisia 掷出所有 $ n $ 个骰子,得到一个数值序列 $ a_1, a_2, \ldots, a_n $($ 1 \le a_i \le 6 $),其中 $ a_i $ 是第 $ i $ 个骰子的上表面数值。这个序列的和等于 $ s $。

突然,Taisia 的宠物猫偷走了恰好一个点数最大的骰子,并计算剩余 $ n-1 $ 个骰子的数值总和,等于 $ r $。

你只知道骰子的数量 $ n $ 和数值 $ s $,$ r $。还原一个可能的序列 $ a $,满足约束条件。

**输入输出格式**

**输入格式**

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

每个测试用例独占一行,包含三个整数 $ n $,$ s $,$ r $($ 2 \le n \le 50 $,$ 1 \le r < s \le 300 $)。

保证存在解决方案。

**输出格式**

对于每个测试用例,输出:$ n $ 个整数 $ a_1, a_2, \ldots, a_n $,顺序任意。保证存在这样的序列。

如果有多个解决方案,输出任意一个。

**输入输出样例**

**输入样例 #1**

```
7
2 2 1
2 4 2
4 9 5
5 17 11
3 15 10
4 4 3
5 20 15
```

**输出样例 #1**

```
1 1
2 2
1 2 2 4
6 4 2 3 2
5 5 5
1 1 1 1
1 4 5 5 5
```**题意翻译** - 有 $ n $ 个六面骰子,其中第 $ i $ 个骰子的点数为 $ a_i $,这 $ n $ 个骰子的点数之和为 $ s $。 - 拿走一个点数最大的骰子,剩余 $ n-1 $ 个骰子的点数之和为 $ r $。 - 给定 $ n, s, r $,请输出任意一个可能的序列 $ a $。 - 本题有 $ t $ 组数据,每组数据一行,即 $ n, s, r $ 的值。 - $ 1\le t\le 1000, 2\le n \le 50, 1\le a_i\le 6, 1\le r < s \le 300 $。 **题目描述** Taisia 有 $ n $ 个六面骰子。每个骰子的每个面都标有一个数字,从 $ 1 $ 到 $ 6 $,每个数字 $ 1 $ 到 $ 6 $ 只用一次。 Taisia 掷出所有 $ n $ 个骰子,得到一个数值序列 $ a_1, a_2, \ldots, a_n $($ 1 \le a_i \le 6 $),其中 $ a_i $ 是第 $ i $ 个骰子的上表面数值。这个序列的和等于 $ s $。 突然,Taisia 的宠物猫偷走了恰好一个点数最大的骰子,并计算剩余 $ n-1 $ 个骰子的数值总和,等于 $ r $。 你只知道骰子的数量 $ n $ 和数值 $ s $,$ r $。还原一个可能的序列 $ a $,满足约束条件。 **输入输出格式** **输入格式** 第一行包含整数 $ t $($ 1 \le t \le 1000 $)——测试用例的数量。 每个测试用例独占一行,包含三个整数 $ n $,$ s $,$ r $($ 2 \le n \le 50 $,$ 1 \le r < s \le 300 $)。 保证存在解决方案。 **输出格式** 对于每个测试用例,输出:$ n $ 个整数 $ a_1, a_2, \ldots, a_n $,顺序任意。保证存在这样的序列。 如果有多个解决方案,输出任意一个。 **输入输出样例** **输入样例 #1** ``` 7 2 2 1 2 4 2 4 9 5 5 17 11 3 15 10 4 4 3 5 20 15 ``` **输出样例 #1** ``` 1 1 2 2 1 2 2 4 6 4 2 3 2 5 5 5 1 1 1 1 1 4 5 5 5 ```

加入题单

算法标签: