#include using namespace std; #include using namespace atcoder; using ll = long long; int n; using P = pair; vector

p; bool isconnect(ll x){ dsu UF(n); for(int i = 0;i1){ ll m = (l+r)/2; if(isconnect(m*10))r = m; else l = m; } cout<> n; p = vector

(n); for(auto &[l,r]:p)cin >> l >> r; solve(); }