#include #include #include #include using namespace std; int main() { int n, k; cin >> n >> k; vector a(n); for (int i = 0; i < n; i++) cin >> a[i]; int m1 = 998, m2 = 998244353; long long res = 0; for (long long i = 0; i < (1LL << n); i++) { bitset<28> I(i); //cout << I << endl; if (I.count() != k) continue; //cout << I << endl; long long sum = 0; for (int j = 0; j < n; j++) { if (I.test(j)) sum += a[j]; } //cout << sum << endl; if (sum % m2 <= sum % m1) res++; } res %= 998; cout << res << endl; }