P29748 [洛谷] [✗✓OI R1] Aluminum Hammer Crafting
普及+
题目描述

Problem Background

DPair plans to bring smiles to everyone with Midrash.

Since Lillia doesn't know what Midrash is, she intends to stop him.

To stop DPair, you need to craft a small aluminum hammer.

If you don't know how to craft a small aluminum hammer, you can refer to the video provided below the problem.

Alternatively, you can choose to solve the easy problem of this monthly competition.

Problem Description

Construct a sequence of positive integers \( a \) such that the product of all elements in \( a \) is \( n \) and the sum of all elements is \( k \). If no such sequence exists, output -1.

Input Format

A single line containing two positive integers \( n \) and \( k \).

Output Format

The first line contains an integer \( m \), representing the length of the sequence.
The next line contains \( m \) positive integers \( a_i \), representing the sequence. It is required that \( 1 \leq m \leq 1000 \) and \( 1 \leq a_i \leq 1000 \).
If there is no valid sequence, output -1 directly.

This problem uses a Special Judge. If there are multiple answers, any one of them will be accepted.

Sample Input and Output

Sample Input #1

67 68

Sample Output #1

2
1 67

Sample Input #2

100 1

Sample Output #2

-1

Sample Input #3

80 16

Sample Output #3

6
1 1 4 5 1 4

Notes

[Sample Explanation]

For the first sample, clearly \( 1 \times 67 = 67 \) and \( 1 + 67 = 68 \).
For the second sample, it can be proven that there is no valid solution.

[Data Range]

For 10% of the data, \( 1 \leq n, k \leq 3 \);
For 30% of the data, \( 1 \leq n, k \leq 10 \);
Additionally, 10% of the data have \( n = k \);
For 100% of the data, \( 1 \leq n, k \leq 100 \).

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
67 68
样例输出
2 1 67