#include <iostream> #include <typeindex> #include <bits/stdc++.h> #include <vector> using namespace std; typedef struct edge{ int x,y; int length; }; vector<int> num; int find(int x){ return num[x]==x?x:find(num[x]); } bool cmp(edge x,edge y){ return...