//There was and will always be only one Chester. RIP legend //--------------------Life is beautiful-------------------- #include using namespace std; #define Nilesh ios_base::sync_with_stdio(false); int main() { Nilesh long long n,k1; cin>>n>>k1; long long a[n+1]; for(int i=1;i<=n;i++) cin>>a[i]; long long answer[n+1]; for(int i=1;i<=n;i++) answer[i]=-1; long long mn,mx,ad,bor; long long i,j,k; for(i=1;i<=n;i++) { for( j=i;j<=n;j++) { ad=a[i],bor=a[i],mn=LONG_LONG_MAX,mx=0; for(k=i;k<=j;k++) { ad&=a[k]; bor|=a[k]; mn=min(mn,a[k]); mx=max(mx,a[k]); } long long cost=(bor-ad)-(mx-mn); if(cost>=k1) { for(int p=i;p<=j;p++) { if(answer[p]