PROGRAMMING:minimum spanning tree
Give an undirected graph, find out the minimum spanning tree, if the graph is not connected, output no [test case: Internet of things engineering level 16 Chen Xiao]
###Input format:
The first line contains two integers n and m, indicating that the graph has n nodes (numbered 1-N) and M undirected edges( N<=5000,M<=100000)
Next, each row of M contains three integers Xi, Yi and Zi, indicating that there is a undirected edge connection node Xi and Yi with the length of Zi
###Output format:
The output contains a number, that is, the sum of the lengths of the edges of the minimum spanning tree; If the graph is not connected, no is output
###Input example:
Here is a set of inputs. For example:
```in
4 5
1 2 2
1 3 2
1 4 3
2 3 4
3 4 3
```
###Output example:
The corresponding output is given here. For example:
```out
seven
```
answer:If there is no answer, please comment
###Input format:
The first line contains two integers n and m, indicating that the graph has n nodes (numbered 1-N) and M undirected edges( N<=5000,M<=100000)
Next, each row of M contains three integers Xi, Yi and Zi, indicating that there is a undirected edge connection node Xi and Yi with the length of Zi
###Output format:
The output contains a number, that is, the sum of the lengths of the edges of the minimum spanning tree; If the graph is not connected, no is output
###Input example:
Here is a set of inputs. For example:
```in
4 5
1 2 2
1 3 2
1 4 3
2 3 4
3 4 3
```
###Output example:
The corresponding output is given here. For example:
```out
seven
```
answer:If there is no answer, please comment