b607: Number Partition

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.

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.

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.

49
6
12
0

2 2 47
2 3 3
2 5 7

[編輯：
(囧rz)
]

 編號 身分 題目 主題 人氣 發表日期 沒有發現任何「解題報告」