#include "bits/stdc++.h" #ifdef PRINTERS #include "printers.hpp" using namespace printers; #define tr(a) cerr<<#a<<" : "< #define vi vector #define vii vector #define mi map #define mii map #define all(a) (a).begin(),(a).end() #define x first #define y second #define sz(x) (int)x.size() #define hell 1000000007 #define endl '\n' #define rep(i,a,b) for(int i=a;i>= 1, r >>= 1) { if (l&1) { t[l]=max(t[l],value); l++; } if (r&1) { t[r-1]=max(t[r-1],value); r--; } } } int query(int p) { int res=-1; for (p += n; p > 0; p >>= 1) res=max(res,t[p]); return res; } void solve() { memset(t,-1,sizeof t); cin>>n>>k; rep(i,0,n) cin>>a[i]; vector>v; rep(i,0,n) { int M=0,m=1e9,O=0,A=(1LL<<31)-1; rep(j,i,n) { A=A&a[j]; M=max(M,a[j]); m=min(m,a[j]); O=O|a[j]; cost=O-A-M+m; if(cost>=k) v.pb({j-i+1,{i,j}}); } } sort(all(v)); for(int i=0;i>t; while(t--) solve(); return 0; }