Format: The graph shall be stored in the following format:
N M
S1 E1 W1
S2 E2 W2
S3 E3 W3
...
SM EM WM
Here, N is the number of nodes in the graph.
M is the number of edges.
Si, Ei are the start and end nodes (just numbers)
of edge i in the graph.
Wi is the weight of edge i in the graph.
The graph is undirected.
The weights are integers.
Nodes are indexed starting at 1.
For example, here is a simple graph of 4 nodes and 5 edges.
4 5
1 2 5
2 3 6
1 3 1
3 4 2
1 4 4
The output will be the minimum spanning tree of the graph in the same
format as the input. Notice that the number of edges is N-1.
For example, the output of the above graph would be:
4 3
1 3 1
3 4 2
1 2 5
When submitting, also submit a few test graphs, as well as
the standard README file.