b607: Number Partition
Tags :
Accepted rate : 36人/84人 ( 43% ) [非即時]

Content

A natural number that is greater than one can be partitioned as a sum of some prime number(s). Your task is to find out as few primes as possible that sum up to the natural number. If the number of such partitions is more than one, only the partition with greatest product of those summands is considered.

Input

Each test case will contains a natural number n, 2 <= n <= 1000000. Input is terminated by a case where the value of n is zero. This case should not be processed.

Output

The input data consists of several test cases. For each test case, output a single line which contains the number of summands and also all summands, separated by a space.
The summands for each test case should be listed in non-decreasing order.

Sample Input #1
49
6
12
0
Sample Output #1
2 2 47
2 3 3
2 5 7

Hint ：
Tags:

[管理者：
(囧rz)
]

 ID User Problem Subject Hit Post Date 22805 (阿普二信) b607 582 2020-10-03 14:49