struct S{ll a,b,j;}; ll@n,@(a--,b--)[n]; sortA(n,a,b); unionFind u('m',2n,1); ll i=0,j=0,z=0; vector v1,v2; rep(y,n){ ll c=0; while(i