intisPrime(int n) { for (int i = 2; i * i <= n; i++) if (n % i == 0) return0; return1; }
voiddfs(int sum, int p, int left) { if (!left) { if (isPrime(sum)) cnt++; return; } for (int i = p; i <= n - left; i++) dfs(sum + num[i], i + 1, left - 1); }
intmain() { scanf("%d%d", &n, &k); for (int i = 0; i < n; i++) scanf("%d", &num[i]); dfs(0, 0, k); printf("%d\n", cnt); return0; }