#include #include #include #include #include using namespace std; struct Edge { int l,r,w; bool operator<(const Edge &b)const { return w>b.w; } }; Edge p[100005]; int set[105]; int m; int map[105][105],w[105]; int find(int x) { if(x==set[x])return x; return set[x]=find(set[x]); } int main() { int T; scanf("%d",&T); while(T--) { scanf("%d",&m); memset(map,0,sizeof(map)); for(int i=0;i