#4306. At Most 3 (Contestant ver.)
At Most 3 (Contestant ver.)
At Most 3 (Contestant ver.)
题目描述
You are given an integer .
You are going to prepare some weights so that all of the conditions below are satisfied.
The number of weights is between and , inclusive. Each weight has a mass of positive integer not exceeding . Every integer between and , inclusive, is a good integer. Here, a positive integer is said to be a good integer if the following condition is satisfied: We can choose at most different weights from the prepared weights with a total mass of .
Print a combination of weights that satisfies the conditions.
输入格式
Input is given from Standard Input in the following format:
输出格式
Print in the following format, where is the number of weights and is the mass of the -th weight. If multiple solutions exist, printing any of them is accepted.
Here, and should satisfy the following conditions:
6
3
1 2 3
12
6
2 5 1 2 5 1
提示
is an integer.在上面的输出中,准备了质量分别为 、 和 的 个砝码。
该输出满足条件。尤其是,关于第 条条件,我们可以确认每个介于 到 (含)之间的整数都是良好整数。
如果我们只选择第 个砝码,则总质量为 。
如果我们只选择第 个砝码,则总质量为 。
如果我们只选择第 个砝码,则总质量为 。
如果我们选择第 个和第 个砝码,则总质量为 。
如果我们选择第 个和第 个砝码,则总质量为 。
如果我们选择第 、第 和第 个砝码,则总质量为 .
你可以准备质量相同的多个砝码。
标签: AtCoder|abc251D
来源
AtCoder|abc251D