#include #include #include using namespace std; #define int long long #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define all(a) a.begin(),a.end() #define rall(c) (c).rbegin(),(c).rend() #define mp make_pair #define endl '\n' typedef long long ll; typedef pair pll; typedef long double ld; const ll inf=1e9+7; const ll mod=1e9+7; //高速化Union-Find木 int siz[200010]; int par[200010]; int depth[200010]; void init(int n){ for(int i=0;i<=n;i++){ par[i]=i; depth[i]=0; } rep(i,n+1){ siz[i]=1; } } int root(int x){ return par[x]==x?x:par[x]=root(par[x]); } bool same(int x,int y){ return root(x)==root(y); } void unite(int x,int y){ x=root(x); y=root(y); ll sx=siz[x]; ll sy=siz[y]; if(x==y)return; if(depth[x]>l>>r; ll ans=0; init(r); REP(i,l,r+1){ ll d=2; while(d*i<=r){ unite(i,d*i); d++; } } vectorused(r+1); REP(i,l,r+1){ if(used[root(i)])continue; ans++; used[root(i)]=1; } ans--; cout<