//no-unlocked { int N, A, B; rd(N, A, B); int X[200010]; rd(X(N)); unionFind uf('m', N, 1); set unvisited; rep(i, N) unvisited.insert(i); rep(i, N) { int l = lower_bound(X, X + N, X[i] + A) - X; int r = upper_bound(X, X + N, X[i] + B) - X - 1; if (l > r) continue; auto it = unvisited.lower_bound(l); while (it != unvisited.end() && *it <= r) { int j = *it; uf.connect(i, j); it = unvisited.erase(it); } } rep(i, N) { wt(uf.size(uf.get(i))); } }