#include #include #include using namespace std; using ll = long long int; int main(){ int n, k; cin >> n >> k; vector a(n); for(auto &p: a) cin >> p; set ans; for(int bit = 0; bit < (1 << n); bit++){ int cnt = 0; ll sum = 0; ll pro = 1; for(int i = 0; i < n; i++){ if(bit & (1 << i)){ sum += a[i]; pro *= a[i]; cnt++; } } if(cnt >= k){ ans.insert(sum); ans.insert(pro); } } //for(auto &p: ans) cerr << p << " "; cout << ans.size() << endl; return 0; }