#define _USE_MATH_DEFINES #include using namespace std; //template #define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define ALL(v) (v).begin(),(v).end() using ll=long long int; const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12; templateinline bool chmax(T& a,T b){if(ainline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;} struct UnionFind{ vector par; int n; UnionFind(){} UnionFind(int _n):par(_n,-1),n(_n){} int root(int x){return par[x]<0?x:par[x]=root(par[x]);} bool same(int x,int y){return root(x)==root(y);} int size(int x){return -par[root(x)];} bool unite(int x,int y){ x=root(x),y=root(y); if(x==y)return false; if(size(x)>size(y))swap(x,y); par[y]+=par[x]; par[x]=y; n--; return true; } }; int main(){ int L,R; cin>>L>>R; int n=R-L+1; UnionFind uni(n); using P=pair; vector

es; rep(x,L,R+1){ int y=x; while(y<=R){ uni.unite(x-L,y-L); y+=x; } y=x+1; while(y<=R){ es.push_back({x-L,y-L}); y+=x; } } int res=0; for(auto& [u,v]:es){ if(uni.unite(u,v))res++; if(uni.n==1)break; } cout<