def find(x): if par[x] == x: return x else: return find(par[x]) def union(x, y): x = find(x) y = find(y) if rank[x] > rank[y]: par[y] = x elif rank[x] < rank[y]: par[x] = y else: par[y] = x rank[x] += 1 tc = int(input()) for idx in range(1, tc+1): v, e = map(int, input().split()) par = list(range(v+1)) # 루트 rank = [0 for _ in range(v+1)] tmp = [] for _ in range(e): n1, n2, w = map(int, input().s..