Problem1560--选数

1560: 选数

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

    已知 n 个整数 x1,x2,…,xn,以及一个整数 kkn)。从 n 个整数中任选 k 个整数相加,可分别得到一系列的和。例如当 n=4k34 个整数分别为 371219 时,可得全部的组合与它们的和为:
    3
712=22  371929  7121938  3121934

    现在,要求你计算出和为素数共有多少种。

    例如上例,只有一种的和为素数:371929)。

Input

    n , k 1<=n<=20kn
    x1,x2
…,xn 1<=xi<=5000000)

Output

    一个整数(满足条件的种数)。

Sample Input Copy

4 3
3 7 12 19

Sample Output Copy

1

Source/Category