#include #define ll long long #define pb push_back using namespace std; ll n,k,i,a[1010101],hz[1010101],j,ka; ll o(ll aa,ll bb) { ll ii,hh=a[aa]; for(ii=aa+1;ii<=bb;ii++) hh=hh|a[ii]; return hh; } ll an(ll aa,ll bb) { ll ii,hh=a[aa]; for(ii=aa+1;ii<=bb;ii++) hh=hh&a[ii]; return hh; } ll ma(ll aa,ll bb) { ll ii,hh=a[aa]; for(ii=aa+1;ii<=bb;ii++) hh=max(hh,a[ii]); return hh; } ll mi(ll aa,ll bb) { ll ii,hh=a[aa]; for(ii=aa+1;ii<=bb;ii++) hh=min(hh,a[ii]); return hh; } int main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>n>>k; for(i=1;i<=n;i++) { cin>>a[i]; hz[i]=-1; } for(i=1;i<=n;i++) { for(j=i;j<=n;j++) { if(k<=(o(i,j)-an(i,j))-(ma(i,j)-mi(i,j))) { for(ka=i;ka<=j;ka++) hz[ka]=max(hz[ka],(j-i)+1); } } cout<