using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var line = Console.ReadLine().Split(' '); var n = int.Parse(line[0]); var a = int.Parse(line[1]); var b = int.Parse(line[2]); line = Console.ReadLine().Split(' '); int i, j; var x = new int[n]; var c = new int[n]; for (i = 0; i < n; i++) { x[i] = int.Parse(line[i]); c[i] = -1; } for (i = 0; i < n; i++) { if (c[i] == -1) { var q = new Queue(); q.Enqueue(i); while (q.Count > 0) { var m = q.Dequeue(); c[m] = i; for (j = 1; m + j < n && Math.Abs(x[m + j] - x[m]) <= b; j++) { if (Math.Abs(x[m + j] - x[m]) >= a && c[m + j] == -1) { q.Enqueue(m + j); } } for (j = 1; m - j > 0 && Math.Abs(x[m - j] - x[m]) <= b; j++) { if (Math.Abs(x[m - j] - x[m]) >= a && c[m - j] == -1) { q.Enqueue(m - j); } } } } } foreach(var z in c) { var sum = 0; for (i = 0; i < n; i++) { if (z == c[i]) { sum++; } } Console.WriteLine(sum); } } } }