import collections class UnionFind(): def __init__(self): self.parents = dict() self.members_set = collections.defaultdict(lambda : set()) self.roots_set = set() self.key_ID = dict() self.ID_key = dict() self.cnt = 0 def dictf(self,x): if x in self.key_ID: return self.key_ID[x] else: self.cnt += 1 self.key_ID[x] = self.cnt self.parents[x] = self.cnt self.ID_key[self.cnt] = x self.members_set[x].add(x) self.roots_set.add(x) return self.key_ID[x] def find(self, x): ID_x = self.dictf(x) if self.parents[x] == ID_x: return x else: self.parents[x] = self.key_ID[self.find(self.ID_key[self.parents[x]])] return self.ID_key[self.parents[x]] def union(self, x, y): x = self.find(x) y = self.find(y) if self.parents[x] > self.parents[y]: x, y = y, x if x == y: return for i in self.members_set[y]: self.members_set[x].add(i) self.members_set[y] = set() self.roots_set.remove(y) self.parents[y] = self.key_ID[x] def size(self, x): return len(self.members_set[self.find(x)]) def same(self, x, y): return self.find(x) == self.find(y) def members(self, x): return self.members_set[self.find(x)] def roots(self): return self.roots_set def group_count(self): return len(self.roots_set) def all_group_members(self): return {r: self.members_set[r] for r in self.roots_set} import bisect N,A,B = map(int,input().split()) x = list(map(int,input().split())) # 下準備、駅xからA〜Bの範囲内にある最初の駅と辺を張る。allにtupleで入れておく。 # 駅xからA~Bの距離間に2つ以上駅があったら記録。tempにtupleで入れておく。 all = [] temp = [] for i in range(N): left = bisect.bisect_left(x,x[i]+A) right = bisect.bisect_right(x,x[i]+B) if right-left==1: all.append((i,left)) elif right-left>=2: all.append((i,left)) temp.append((left,right-1)) #tempにある辺について重複区間の処理をする if temp: temp.sort(key=lambda x:x[0]) new = [] now = temp[0] for i in range(1,len(temp)): if now[1]