#include #define ll long long #define ld long double #define fi first #define se second #define pll pair #define INF (1ll << 60) #define ppl pair #define vl vector #define vvl vector #define FOR(i,a,b) for(ll i=a;i & a){ int res=0; for(ll x : a){ if((x & (1<<(29-pos))) != 0){ res++; } } return res; } vector getOnes(int pos , vector a){ vector tmp; for(ll x:a){ if((x & (1<<(29-pos))) != 0){ tmp.push_back(x); } } return tmp; } int main() { ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); int n,k; cin>>n>>k; vl a(n); for(int i=0;i>a[i]; // int temp= a[i]; // while(temp!=0){ // cout << temp%2; // temp/=2; // } // cout << " " << a[i] << endl; } for(int pos=0;pos<30;pos++){ // cout << pos << " " << countOnes(pos, a) << endl; if(countOnes(pos, a) >= k){ // cout << pos << endl; a = getOnes(pos, a); // for(int id : a){ // cout << id << " "; // } // cout << endl; } } ll sum=(1LL<<30)-1; // cout<