优秀的拆分 (Excellent Split)
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Description
Generally speaking, a positive integer can be split into the sum of several positive integers.
Example: .
For a positive integer we call it excellent if and only if under this kind of separation, is broken down into several different numbers such that each number is a positive power of . Note that a number can be expressed as a positive power of , if and only if for some integer .
Example: is an excellent split. But, is not an excellent split, because is not to the power of a positive integer.
Now, given a positive integer , you need to judge whether there is an excellent split among all the splits of this number. If so, please give a specific split plan.
Input Format
The input is only one line, an integer , that represents the number to be split.
Output Format
If there is an excellent split among all the splits of this number, then you need to output each number in this split from largest to smallest, separated by a space between two adjacent numbers. It can be proved that after the order of splitting numbers is specified, the splitting plan is unique.
If there is no excellent split, output -1
.
6
4 2
7
-1
Constraints
For of the data, .
For another of the data, is guaranteed to be odd.
For another of the data, is guaranteed to be a positive power of .
For of the data, .
For of the data, .
2023级晚训第4周练习,截止时间为10天
- 状态
- 已结束
- 规则
- IOI
- 题目
- 12
- 开始于
- 2023-11-6 21:45
- 结束于
- 2023-12-6 21:45
- 持续时间
- 720 小时
- 主持人
- 参赛人数
- 132