PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#QHD0000058. Tổng của các số nguyên tố phân biệt (Sum of Different Primes)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

2 lộ trình

Tổng của các số nguyên tố phân biệt (Sum of Different Primes)

Sum of Different Primes

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

A positive integer may be expressed as the sum of distinct prime numbers. For example, 24=2+3+19=2+5+1724=2+3+19=2+5+17 gives two different sets of three primes.

Given positive integers nn and kk, count the sets of exactly kk pairwise distinct primes whose sum is nn. Order does not matter, so 3+53+5 and 5+35+3 represent the same choice. Each prime can be used at most once. The number 11 is not a prime.

Print the exact number of such sets, with no modulus. For the stated limits, the answer is less than 2312^{31}.

Input

A single line contains positive integers n,kn,k. There is no terminating 0 0 pair.

Output

Print one nonnegative integer: the number of sets of exactly kk distinct primes summing to nn.

Subtasks

  • Subtask 1 (20 points): 1≤n≤1201\le n\le120, 1≤k≤51\le k\le5; use distinct positive primes not exceeding nn.

  • Subtask 2 (30 points): 1≤n≤6001\le n\le600, 1≤k≤91\le k\le9; use distinct positive primes not exceeding nn.

  • Subtask 3 (50 points): 1≤n≤11201\le n\le1120, 1≤k≤141\le k\le14; use distinct positive primes not exceeding nn; the answer is below 2312^{31}.

Examples

Input


24 3

Output


2

Explanation

The only sets of three distinct primes summing to 2424 are {2,3,19}\{2,3,19\} and {2,5,17}\{2,5,17\}. Permuting elements of a set does not create a new representation; the output is 2. With n=24,k=2n=24,k=2, the valid sets are {5,19}\{5,19\}, {7,17}\{7,17\}, and {11,13}\{11,13\}.