#CSPJ2020A. 优秀的拆分 (Excellent Split)
优秀的拆分 (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, .
相关
在下列比赛中: