#P2563. [AHOI2001] 质数和分解

    ID: 1566 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>2001各省省选安徽背包素数判断,质数,筛法

[AHOI2001] 质数和分解

Description

Any natural number nn greater than 11 can be written as a sum of primes each greater than or equal to 22 and less than or equal to nn (including the case where the sum consists of only one number), and there may be more than one such prime-sum form. For example, the prime-sum expressions of 99 have four essentially different forms:

9=2+5+2=2+3+2+2=3+3+3=2+79 = 2 + 5 + 2 = 2 + 3 + 2 + 2 = 3 + 3 + 3 = 2 + 7

Two expressions are considered essentially the same if one can be obtained from the other by permuting the addends.

Write a program to compute how many essentially different prime-sum expressions a natural number nn can have.

Input Format

Each line of the file contains a natural number nn (2n2002 \leq n \leq 200).

Output Format

For each natural number nn, output the number of essentially different prime-sum expressions.

2
200
1
9845164

Hint

Translated by ChatGPT 5