Skip to content
C

Minimum Spanning Tree

Hardjavapythonccppjavascript

Given a connected weighted undirected graph, find the total weight of its Minimum Spanning Tree.

Input Format

The first line contains two integers V and E. Each of the next E lines contains an undirected weighted edge u v w.

Output Format

Print the total weight of the Minimum Spanning Tree.

Input (stdin)

Output

Run your code to see output here...