#include #include using namespace std; using namespace atcoder; using ll=long long; using ld=long double; ll inf=10010010010010010; ll mod=998244353; int main(){ ll n,a,b; cin >> n >> a >> b; vectorx(n); set>s; s.insert({inf,inf}); for (ll i = 0; i < n; i++) { cin >> x[i]; s.insert({x[i],i}); } vectorans(n); while (1) { auto v=s.lower_bound({-1,-1}); pairp=*(v); s.erase(p); if (p.first==inf) { break; } vector>memo; memo.push_back(p); for (ll i = 0; i < memo.size(); i++) { v=s.lower_bound({memo[i].first+a,-1}); pairq=*(v); while (a<=abs(q.first-memo[i].first)&&abs(q.first-memo[i].first)<=b) { s.erase(q); memo.push_back(q); v=s.lower_bound(q); q=*(v); } v=s.lower_bound({memo[i].first-b,-1}); q=*(v); while (a<=abs(memo[i].first-q.first)&&abs(memo[i].first-q.first)<=b) { s.erase(q); memo.push_back(q); v=s.lower_bound(q); q=*(v); } } for (ll i = 0; i < memo.size(); i++) { ans[memo[i].second]=memo.size(); } } for (ll i = 0; i < ans.size(); i++) { cout << ans[i] << endl; } }