Very Important Edge
시간 제한3초메모리 제한2048 MB
가중치가 있는 단순 연결 그래프에서 간선 하나를 지웠을 때 최소 신장 트리 무게가 가장 커지도록 하는 간선을 골라, 그 무게를 출력한다.
문제
You are given a simple connected graph where each edge is assigned a non-negative weight. Recall that a minimum spanning tree of a graph is a connected, acyclic subset of the edges of the graph with minimum total weight. Find an edge which maximizes the minimum spanning tree weight of a given graph if that edge is deleted. It is guaranteed that the input graph remains connected after deleting any one edge.
입력
The first line of input contains two integers () and (), where is the number of vertices and is the number of edges in the input graph. The vertices are numbered from to .
Each of the next lines contains three integers , () and (). This denotes an edge between vertices and with weight .
출력
Output a single integer, which is the minimum spanning tree weight of the input graph after the right edge is deleted.