#include #define rep(i,start,lim) for(lld i=start;i=lim;i--) #define scan(x) scanf("%lld",&x) #define print(x) printf("%lld ",x) #define f first #define s second #define pb push_back #define mp make_pair #define br printf("\n") #define sz(a) lld((a).size()) #define YES printf("YES\n") #define NO printf("NO\n") #define all(c) (c).begin(),(c).end() using namespace std; #define INF 1011111111 #define LLINF 1000111000111000111LL #define EPS (double)1e-10 #define MOD 1000000007 #define PI 3.14159265358979323 using namespace std; typedef long double ldb; typedef long long lld; lld powm(lld base,lld exp,lld mod=MOD) {lld ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;} typedef vector vlld; typedef pair plld; typedef map mlld; typedef set slld; #define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define endl '\n' #define N 1000005 #define fre freopen("1.in","r",stdin); freopen("1.out","w",stdout); lld a[N]; int main() { sync; lld n,kk; cin>>n>>kk; rep(i,1,n+1) cin>>a[i]; rep(i,1,n+1) { lld orr = 0, andd = ((1LL<<60)-1), maxm = 0, minm = LLINF; lld ans = -1; repd(j,i,1) { orr |= a[j]; andd &= a[j]; maxm = max(maxm, a[j]); minm = min(minm, a[j]); lld tmporr = orr, tmpandd = andd, tmpmaxm = maxm, tmpminm = minm; rep(k,i,n+1) { tmporr |= a[k]; tmpandd &= a[k]; tmpmaxm = max(tmpmaxm, a[k]); tmpminm = min(tmpminm, a[k]); lld curr = ((tmporr - tmpandd) - (tmpmaxm - tmpminm)); //cout<= kk) ans = max(ans, (k-j+1)); } } cout<