#P454. 练82.3 选数

练82.3 选数

Description

Given nn integers x1x_1, x2x_2, ..., xnx_n, and an integer kk (k<nk < n). From these nn integers, choose any kk integers and add them together to get a series of sums. For example, when n=4n=4, k=3k=3, and the 44 integers are 33, 77, 1212, 1919, all possible combinations and their sums are:
3+7+12=223+7+12=22
3+7+19=293+7+19=29
7+12+19=387+12+19=38
3+12+19=343+12+19=34
Now, you need to calculate how many of these sums are prime numbers.
In the example above, only one sum is prime: 3+7+19=293+7+19=29.

Input Format

The first line contains nn and kk (1n201 ≤ n ≤ 20, k<nk < n).
The second line contains nn numbers:
x1x_1 x2x_2 ... xnx_n (1xi50000001 ≤ x_i ≤ 5000000), separated by spaces.

Output Format

A single integer representing the number of combinations that sum to a prime number.

Sample

4 3
3 7 12 19
1