using namespace std; int fa[MAXN], mincost[MAXN]; vector<int>edge[MAXN]; priority_queue<int>cost[MAXN]; int n, m, dep; void init() { for (int i = 1; i <= n; ++i) { fa[i] = i; mincost[i] = n; edge[i].clear(); while (!cost[i].empty()) cost[i].pop(); } dep = 0; } void dfs(int u, i...