#include #define rep(i,n) for(int i=0; i<(int)(n); i++) using namespace std; using LL = long long; class UnionFind { public: vector par; vector siz; UnionFind(LL sz_): par(sz_), siz(sz_, 1LL) { for (LL i = 0; i < sz_; ++i) par[i] = i; } void init(LL sz_) { par.resize(sz_); siz.assign(sz_, 1LL); for (LL i = 0; i < sz_; ++i) par[i] = i; } LL root(LL x) { while (par[x] != x) { x = par[x] = par[par[x]]; } return x; } bool unite(LL x, LL y) { x = root(x); y = root(y); if (x == y) return false; if (siz[x] < siz[y]) swap(x, y); siz[x] += siz[y]; par[y] = x; return true; } bool same(LL x, LL y) { return root(x) == root(y); } LL size(LL x) { return siz[root(x)]; } }; struct edge{ int from, to; LL cost; edge(int from, int to, LL cost): from(from), to(to), cost(cost) {} bool operator<(const edge &e) const{ return cost < e.cost; } }; vector es; LL kruskal(int siz){ sort(es.begin(),es.end()); UnionFind uf(siz); LL res=0; rep(i,es.size()){ edge e=es[i]; if(!uf.same(e.from, e.to)){ uf.unite(e.from, e.to); res+=e.cost; } } return res; } int main(){ int L, R; cin >> L >> R; for(int i=L; i