#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
struct node{
int u,v,w;
};
vector<node> g;
bool cmp(node a,node b){
return a.w < b.w;
}
int rt[maxn];
int find(int x){
if (x == rt[x]) return x;
rt[x] = find(rt[x]); // 路径压缩
return r...