11781178 SUSTech Online Judge
Problem 1178 --Spanning Tree 2.0

1178: Spanning Tree 2.0

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 570  Solved: 149
[Submit][Status][Web Board]

Description

Input

Output

Sample Input

1
4 5
1 2 1
1 3 2
1 4 3
3 4 2
2 3 2

Sample Output

6

HINT

Source

[Submit][Status]