#include using namespace std; typedef long long int ll; const int N = 105; ll mx[N][N], mi[N][N], ands[N][N], ors[N][N]; ll A[N]; ll cost[N][N]; ll n,k; vector costlyIntervals() { // Return a list of length n consisting of the answers vector res(n+1,-1); for (int i=1;i<=n;++i) { for (int j=i;j<=n;++j) { cost[i][j] = (ors[i][j]-ands[i][j]) - (mx[i][j]-mi[i][j]); if (cost[i][j] >= k) { for(int i1=i;i1<=j;++i1) { res[i1] = max(res[i1],j-i+1); } } } } return res; } int main() { cin >> n >> k; if (n>N) return 0; for(int A_i = 1; A_i <= n; A_i++){ cin >> A[A_i]; } for(int i=1;i<=n;++i) { mx[i][i] = mi[i][i] = ands[i][i] = ors[i][i] = A[i]; for (int j=1;j+i<=n;++j) { mx[i][i+j] = max(mx[i][i+j-1], A[i+j]); mi[i][i+j] = min(mi[i][i+j-1], A[i+j]); ands[i][i+j] = (ands[i][i+j-1] & A[i+j]); ors[i][i+j] = (ors[i][i+j-1] | A[i+j]); } } vector result = costlyIntervals(); for (size_t i = 1; i < result.size(); i++) { cout << result[i] << (i != result.size() ? "\n" : ""); } cout << endl; return 0; }