Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Sum of Different Primes
Description A positive integer may be expressed as a sum of different prime numbers (primes), in one way or another. Given two positive integers When Your job is to write a program that reports the number of such ways for the given Input The input is a sequence of datasets followed by a line containing two zeros separated by a space. A dataset is a line containing two positive integers Output The output should be composed of lines, each corresponding to an input dataset. An output line should contain one non-negative integer indicating the number of the ways for Sample Input 24 3 24 2 2 1 1 1 4 2 18 3 17 1 17 3 17 4 100 5 1000 10 1120 14 0 0 Sample Output 2 3 1 0 0 2 1 0 1 55 200102899 2079324314 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator