#include #include #include using namespace std; struct unionfind { vector par,_size; unionfind(long n) : par(n+1), _size(n+1,1) { for(long long i=0; i(n); _size = vector(n); for(long long i=0; i> n >> a >> b; vector x(n,0); for (int i=0; i> x[i]; for (int i=0; i= u) continue; uni.merge(i,l-x.begin()); for (int j=l-x.begin(); j