#include #define st first #define nd second #define fi first #define se second #define pb push_back #define loop(i,j,n) for(int i=j;i pll; const int MAX = 200010; ll A[MAX]; int C[32]; void divd(ll a) { int i=0; while(a>0) { C[i] += a%2; //ps(a%2); a/=2; i++; } //pln(""); } bool R[MAX]; int main() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n,k; cin>>n>>k; loop(i,0,n) { cin>>A[i]; divd(A[i]); } int f=30; while(f>=0 && C[f] < k) { f--; } if(f < 0) { pln(0); return 0; } ll res = 0; loop(i,0,n) if(!(A[i]&1< tR; while(f>=0) { int ss = 0; loop(i,0,n) { //ps(A[i]); if(!(A[i] & 1<=k) { for(ll r : tR) { R[r] = 1; } tR.clear(); res += 1<