luogu#P7947. [✗✓OI R1] 铝锤制作
[✗✓OI R1] 铝锤制作
Background
DPair plans to use Midrash to bring smiles to everyone.
Because Lillia does not know what Midrash is, they plan to stop them.
To stop DPair, you need to make a small aluminum hammer.
If you do not know how to make a small aluminum hammer, you can refer to the video provided below the problem.
Or, you can also choose to treat this as the check-in problem for this monthly contest.
Problem Description
Construct a positive integer sequence such that the product of all elements in is , and the sum of all elements is . If such a sequence does not exist, output -1.
Input Format
One line contains two positive integers .
Output Format
The first line contains an integer , representing the length of the sequence.
The next line contains positive integers , representing the sequence. It is required that and .
In particular, if there is no sequence that meets the requirements, output -1 directly.
This problem uses a Special Judge. If there are multiple answers, output any one of them.
67 68
2
1 67
100 1
-1
80 16
6
1 1 4 5 1 4
Hint
Sample Explanation
For sample 1, it is clear that and .
For sample 2, it can be proven that there is no valid solution.
Constraints
For of the testdata, .
For of the testdata, .
For another of the testdata, .
For of the testdata, .
Translated by ChatGPT 5