#include // clang-format off using namespace std;constexpr int INF=1001001001;constexpr long long INFll=1001001001001001001;namespace viewer{using s=string;templates f(T i){s S=i==INF||i==INFll?"inf":to_string(i);return s(max(0,3-int(S.size())),' ')+S;} templateauto v(T&x,s&&e)->decltype(cerr<void v(const pair&p,s&&e="\n"){cerr<<"(";v(p.first,", ");v(p.second,")"+e);}templatevoid v(const tuple&t,s&&e="\n"){cerr<<"(";v(get<0>(t),", ");v(get<1>(t),")"+e);}templatevoid v(const tuple&t,s&&e="\n"){cerr<<"(";v(get<0>(t),", ");v(get<1>(t),", ");v(get<2>(t),")"+e);}templatevoid v(const tuple&t,s&&e="\n"){cerr<<"(";v(get<0>(t),", ");v(get<1>(t),", ");v(get<2>(t),", ");v(get<3>(t),")"+e);} templatevoid v(const vector&vx,s);templateauto ve(int,const vector&vx)->decltype(cerr<auto ve(bool,const vector&vx){cerr<<"{\n";for(const T&x:vx)cerr<<" ",v(x,",");cerr<<"}\n";}templatevoid v(const vector&vx,s){ve(0,vx);} templatevoid v(const deque&q,s&&e){v(vector(q.begin(),q.end()),e);}templatevoid v(const set&S,s&&e){v(vector(S.begin(),S.end()),e);}templatevoid v(const multiset&S,s&&e){v(vector(S.begin(),S.end()),e);}templatevoid v(const unordered_set&S,s&&e){v(vector(S.begin(),S.end()),e);} templatevoid v(const priority_queue&p,s&&e){priority_queueq=p;vectorz;while(!q.empty()){z.push_back(q.top());q.pop();}v(z,e);}templatevoid v(const map&m,s&&e){cerr<<"{"<<(m.empty()?"":"\n");for(const auto&kv:m){cerr<<" [";v(kv.first,"");cerr<<"] : ";v(kv.second,"");cerr<<"\n";}cerr<<"}"+e;} templatevoid _view(int n,s&S,T&var){cerr<<"\033[1;32m"<void grid(T _){}void grid(const vector>&vvb){cerr<<"\n";for(const vector&vb:vvb){for(const bool&b:vb)cerr<<(b?".":"#");cerr<<"\n";}} void _debug(int,s){}templatevoid _debug(int n,s S,const H&h,const T&... t){int i=0,cnt=0;for(;iap;mint re=a;for(long long r=1;r -sz[a] - 1 = edge[a] O(N) int num_of_tree(){int num_of_tree=0;for(int a=0;a<_n;a++)if(par_or_sz[a]<0&&-par_or_sz[a]>edge[a])num_of_tree++;return num_of_tree;} // the list of the "list of the vertices in a connected component" O(N) vector>groups(bool index1=false){vector>ret(_n);for(int i=0;i<_n;i++)ret[find(i)].push_back(i+int(index1));ret.erase(remove_if(ret.begin(),ret.end(),[&](const vector&v){return v.empty();}),ret.end());return ret;} // UnionFind::groups().size() O(1) int group_count(){return group_cnt;} protected: int _n;int group_cnt;/* root node: -1 * component size , otherwise: parent */vectorpar_or_sz;vectoredge; }; /// @ref https://qiita.com/drken/items/cce6fc5c579051e64fab /// @brief merge(a,b,w): A[a] - A[b] == z /// diff(a,b): A[b]-A[a] (REQUIRE:same(a,b)) template struct weighted_dsu : UnionFind { explicit weighted_dsu(int n,Abel SUM_UNITY=0):diff_weight(n,SUM_UNITY){_n=n;group_cnt=0;par_or_sz.resize(n,-1);} int find(int a)override{assert(0<=a&&a<_n);if(par_or_sz[a]<0)return a;int r=find(par_or_sz[a]);diff_weight[a]+=diff_weight[par_or_sz[a]];return par_or_sz[a]=r;} int merge(int a,int b,Abel w){assert(0<=a&&a<_n&&0<=b&&b<_n);w+=weight(a)-weight(b);int x=find(a),y=find(b);if(x==y)return x;group_cnt--;if(-par_or_sz[x]<-par_or_sz[y])swap(x,y),w=-w;par_or_sz[x]+=par_or_sz[y];diff_weight[y]=w;return par_or_sz[y]=x;} Abel weight(int a){find(a);return diff_weight[a];} Abel diff(int a, int b){assert(same(a,b));return weight(b)-weight(a);} private:vector diff_weight;}; /// @ref https://misteer.hatenablog.com/entry/persistentUF /// @ref https://ei1333.github.io/library/structure/union-find/partially-persistent-union-find.cpp /// @brief UnionFind which can reference all previous versions and update the current (not previous) version. /// @note t = -1 is the initial time.(each node's parent is itself) struct partially_persistent_dsu { partially_persistent_dsu(int n):_n(n),par_or_sz(n,-1),last(n,INF),add(n,{{-1,-1}}){} int merge(int a,int b,int t){assert(0<=a&&a<_n&&0<=b&&b<_n);int x=find(a,t),y=find(b,t);if(x==y)return x;if(-par_or_sz[x]<-par_or_sz[y])swap(x,y);last[y]=t;par_or_sz[x]+=par_or_sz[y];add[x].emplace_back(t,par_or_sz[x]);return par_or_sz[y]=x;} int find(int a,int t){assert(0<=a&&a<_n);if(tsecond;} private:int _n;vectorpar_or_sz;vectorlast;vector>>add;}; // clang-format on int main() { cin.tie(0); ios::sync_with_stdio(false); int N, A, B; cin >> N >> A >> B; vector Xs(N); for (int i = 0; i < N; i++) { cin >> Xs[i]; } UnionFind uf(N); int next_A = A; for (int i = 0; i < N - 1; i++) { int idx_l = distance(Xs.begin(), lower_bound(Xs.begin(), Xs.end(), Xs[i] + next_A)); int idx_r = distance(Xs.begin(), lower_bound(Xs.begin(), Xs.end(), Xs[i] + B)); if (idx_r < N && Xs[idx_r] == Xs[i] + B) { idx_r++; } for (int j = idx_l; j < idx_r; j++) { uf.merge(i, j); } if (Xs[i] + A <= Xs[i + 1] && Xs[i + 1] <= Xs[i] + B) { next_A = max(A, B - (Xs[i + 1] - Xs[i])); } else { next_A = A; } } debug(uf.groups()); for (int i = 0; i < N; i++) { cout << uf.size(i) << endl; } return 0; }