E. Minimum Spanning Tree
time limit per test
2.0 s
memory limit per test
512 MB
input
standard input
output
standard output
In the mathematical discipline of graph theory, the line graph of a simple undirected weighted graph GG is another simple undirected weighted graph L(G)L(G) that represents the adjacency between every two edges in GG.
Precisely speaking, for an undirected weighted graph GG without loops or multiple edges, its line graph L(G)L(G) is a graph such that:
- Each vertex of L(G)L(G) represents an edge of GG.
- Two vertices of L(G)L(G) are adjacent if and only if their corresponding edges share a common endpoint in GG, and the weight of such edge between this two vertices is the sum of their corresponding edges' weight.
A minimum sp