#include <bits/stdc++.h> using namespace std; struct Edge{ int u, v; int w; }; bool inSameSet(int *uni, int r1, int r2) { while(r1 != uni[r1]) r1 = uni[r1]; while(r2 != uni[r2]) ...