#include #define rep(i,n) for (int i = 0; i < (int)(n); i ++) #define irep(i,n) for (int i = (int)(n) - 1;i >= 0;--i) using namespace std; using ll = long long; using PL = pair; using P = pair; constexpr int INF = 1000000000; constexpr long long HINF = 1000000000000000; constexpr long long MOD = 1000000007;// = 998244353; constexpr double EPS = 1e-4; constexpr double PI = 3.14159265358979; struct UnionFind { int N; vector parents; UnionFind(int _N) : N(_N){ parents.assign(N,-1); } int find(int x) { //xの親を返す if (parents[x] < 0) return x; return parents[x] = find(parents[x]); } void unite(int x, int y) { //xとyの含むグループを併合 int px = find(x); int py = find(y); if (parents[px] > parents[py]) swap(px,py); if (px != py) { parents[px] += parents[py]; parents[py] = px; } } bool same(int x, int y) { //x,yが同じグループにいるか判定 return find(x) == find(y); } int size(int x) { //xと同じグループのメンバーの個数 return -parents[find(x)]; } vector root() {//ufの根を列挙 vector res; for (int i = 0; i < N; i ++) { if (parents[i] < 0) res.push_back(i); } return res; } int group_count() { //ufのグループの数を数える int cnt = 0; for (int i = 0; i < N; i ++) { if (parents[i] < 0) cnt ++; } return cnt; } }; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; ll A,B; cin >> N >> B >> A; vector X(N); rep(i,N) cin >> X[i]; UnionFind uf(N); rep(i,N) { int l = lower_bound(X.begin(),X.end(),X[i] - A) - X.begin(); if (l < N && X[l] <= X[i] - B) uf.unite(i,l); int r = lower_bound(X.begin(),X.end(),X[i] + B) - X.begin(); if (r < N && X[r] <= X[i] + A) uf.unite(i,r); } rep(i,N - 1) { int l = lower_bound(X.begin(),X.end(),X[i + 1] - A) - X.begin(); if (l < N && X[l] <= X[i] - B) uf.unite(i,i + 1); int r = lower_bound(X.begin(),X.end(),X[i + 1] + B) - X.begin(); if (r < N && X[r] <= X[i] + A) uf.unite(i,i + 1); } rep(i,N) cout << uf.size(i) << '\n'; return 0; }