//kruskal tree #include #include #include #include using namespace std; #define M 1000000 int parent[M],a[M],b[M]; pairnode[M]; int root(int a){return parent[a]==a?a:parent[a]=root(parent[a]);} int unite(int a,int b){ int x=root(a),y=root(b); if(x==y)return 0; parent[x]=y; return 1; } int main(){ int N; scanf("%d",&N); vector >v(N); { vector >V(N); for(int i=0;i