#include<bits/stdc++.h> #define endl "\n" #define int long long using namespace std; struct node { int u, v, w; bool operator <(const node& t)const { return w > t.w; } }; void slove() { int n; std::cin >> n; std::unordered_map<int, int> mp; std::vector<node&g...