#include using namespace std; typedef long long ll; typedef double dbl; #define fr(x,a,b) for(ll x=a;x=1;i--){ tree[i].min_val=min(tree[i*2].min_val,tree[(i*2)+1].min_val); tree[i].max_val=max(tree[i*2].max_val,tree[(i*2)+1].max_val); tree[i].or_val=(tree[i*2].or_val|tree[(i*2)+1].or_val); tree[i].and_val=(tree[i*2].and_val&tree[(i*2)+1].and_val); tree[i].cost=(tree[i].or_val-tree[i].and_val)-(tree[i].max_val-tree[i].min_val); } } ll query(ll left,ll right){ ll min_val=INF; ll max_val=-INF; ll or_val=0; ll and_val; left+=n; right+=n; ll ft=1; while(left>n>>k; ll a[n],ans[n]; fr(i,0,n) cin>>a[i]; build(a); fr(i,0,n) ans[i]=-1; fr(i,0,n){ fr(j,i,n){ if(query(i,j+1)>=k){ fr(ind,i,j+1){ ans[ind]=max(ans[ind],j-i+1); } } } } fr(i,0,n) cout<