#include using namespace std; typedef long long ll; #define totori signed template bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;} template bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;} ll dx[4]={0,1,-1,0}; ll dy[4]={1,0,0,-1}; class UnionFind{ public: //親の番号を格納する。親だった場合は-(その集合のサイズ) vector parent; UnionFind(int N){ parent = vector(N,-1); } int root(int A){ if(parent[A] < 0) return A; return parent[A]=root(parent[A]); } int size(int A){ return -parent[root(A)]; } bool unite(int A, int B) { A = root(A), B = root(B); if(A == B) return false; if(size(A) < size(B)) swap(A,B); parent[A] += parent[B]; parent[B] = A; return true; } bool same(int A, int B){ return root(A)==root(B); } }; totori main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(20); int n,a,b; cin>>n>>a>>b; int x[n]; for(int i=0;i>x[i]; UnionFind uni(n); int r = 0; for(int i=0;ii && x[r-1]-x[i]>=a && x[r-1]-x[i]>=a)uni.unite(r-1,i); while(r=a)uni.unite(i,r); r++; } } for(int i=0;i