#T390. 选数

选数

Description

Given n integers x1, x2, ..., xn, and an integer k (k < n). Select any k integers from the n integers and add them together to obtain a series of sums. For example, when n=4, k=3, and the 4 integers are 3, 7, 12, and 19, all possible combinations and their sums are:
3 + 7 + 12 = 22
3 + 7 + 19 = 29
7 + 12 + 19 = 38
3 + 12 + 19 = 34.
Now, you are required to calculate how many of these sums are prime numbers.
In the example above, there is only one sum that is a prime number: 3 + 7 + 19 = 29.

Input Format

Input from the keyboard, formatted as:
n, k (1 ≤ n ≤ 20, k < n)
x1, x2, ..., xn (1 ≤ xi ≤ 5000000)

Output Format

Output to the screen, formatted as:
A single integer (the number of valid combinations).

4 3
3 7 12 19
1

Translation

NOIP2002-J2

(Note: Since "NOIP2002-J2" appears to be a competition identifier or code name without additional context, I've kept it untranslated as it's likely an official designation. If this refers to a specific competition level or problem set, you may want to provide more details for a more accurate translation.)