#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #define _USE_MATH_DEFINES #include #include using namespace std; //#include //using namespace atcoder; #define REP(i,n) for(int i = 0; i < (int)n; i++) #define RREP(i,n) for(int i = (int)n-1; i >= 0; i--) #define LREP(i,n) for(LL i = 0; i < (LL)n; i++) #define Vi vector #define Vl vector #define LP pair #define P pair #define T3 tuple #define T4 tuple #define INF 1000000007 #define SIZE 300010 #define MOD 1000000007 typedef long long LL; int N, A, B; int X[SIZE]; int parent[SIZE], s[SIZE]; void init() { REP(i, N) { parent[i] = i; s[i] = 1; } } int par(int a) { if (parent[a] == a) return a; else return parent[a] = par(parent[a]); } void merge(int a, int b) { int pa = par(a), pb = par(b); if(pa != pb) { parent[pb] = pa; s[pa] += s[pb]; } } bool same(int a, int b) { int pa = par(a), pb = par(b); if (pa == pb) return true; else return false; } int size(int a) { int pa = par(a); return s[pa]; } int main() { cin >> N >> A >> B; REP(i, N) cin >> X[i]; X[N] = 2 * INF; init(); queue que; int left = 0, right = 0; REP(i, N) { while (X[right] <= B + X[i]) { que.push(X[right]); right += 1; } while (X[left] < A + X[i] && que.size()) { que.pop(); left += 1; } if (que.size()) { merge(i, left); } for (int j = right - 1; j > left; j--) { if (same(j, j - 1)) break; else merge(j, j - 1); } } REP(i, N) { cout << size(i) << endl; } }