#include #include #include #include #include using namespace std; #define MAXN 100100 #define MAXM 1000100 #define MAXW 1000100 using LL = long long; struct edge { int u,v,w; }; bool cmp(const edge& a,const edge& b) { return a.w> vec[MAXN]; int findfather(int x) { return father[x]==x?x:father[x]=findfather(father[x]); } /// Global For DFS LL totalans; LL dfs(int index) { vis[index]=1; int sz=vec[index].size(); LL ksum=0; LL nextans=0; for(int i=0;i