//#define _GLIBCXX_DEBUG #include #define FOR(i,a,b) for(int i=a;i=b;i--) #define per(i,a) ROF(i,a,0) #define pb push_back using namespace std; using ll=long long; using ld=long double; using ch=char; typedef pair P; typedef vector vl; typedef vector vvl; typedef vector

vP; typedef vector vc; typedef vector vvc; const ll MOD=1000000007; const ll MOD2=998244353; const ld PI=acos(-1); const ll INF=1e18; struct edge{ll to,cost;}; struct edge2{ll from,to,cost;}; template bool chmax(T &a, const T& b) { if (a < b) { a = b; return true; } return false; } template bool chmin(T &a, const T& b) { if (a > b) { a = b; return true; } return false; } struct UnionFind { vector par; vector rnk; vector siz; UnionFind(int N):par(N),rnk(N),siz(N){ for (int i=0;i> N >> A >> B; vl X(N); rep(i,N){ cin >> X[i]; } X.pb(INF); UnionFind uf(N); vl d(N,0); rep(i,N){ int l=lower_bound(X.begin(),X.end(),X[i]+A)-X.begin(); int r=upper_bound(X.begin(),X.end(),X[i]+B)-X.begin()-1; if(l>r)continue; uf.unite(i,l); d[l]++;d[r]--; } rep(i,N-1){ d[i+1]=d[i]+d[i+1]; } rep(i,N-1){ if(d[i]>0){ uf.unite(i,i+1); } } rep(i,N){ cout << uf.size(i) << endl; } } /* overflow checked? corner case checked? boundary checked? not TLE in worst case checked? */