116. Index of super-prime

116. Index of super-prime

time limit per test: 0.25 sec.
memory limit per test: 4096 KB

Let P1, P2, … ,PN, … be a sequence of prime numbers. Super-prime number is such a prime number that its current number in prime numbers sequence is a prime number too. For example, 3 is a super-prime number, but 7 is not. Index of super-prime for number is 0 if it is impossible to present it as a sum of few (maybe one) super-prime numbers, and if such presentation exists, index is equal to minimal number of items in such presentation. Your task is to find index of super-prime for given numbers and find optimal presentation as a sum of super-primes.

Input

There is a positive integer number in input. Number is not more than10000.

Output

Write index I for given number as the first number in line. WriteI super-primes numbers that are items in optimal presentation for given number. Write theseInumbers in order of non-increasing.

Sample Input

6

Sample Output

2
3 3
 
素数序列 : 2 3 5 7 11 13 17 19 23
3 在该序列中的位置是2,2也是素数,所以3是super-prime
7 在该序列中的位置是4,4不是素数,所以4不是super-prime
现在给出一个数,求它至少由几个super-prime组成,如果不能由super-number构成,输出0

                
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值