http://codeforces.com/contest/1108/problem/F
You are given an undirected weighted connected graph with nn vertices and mm edges without loops and multiple edges.
The ii -th edge is ei=(ui,vi,wi)ei=(ui,vi,wi) ; the distance between vertices uiui and vivi along the edge eiei is wiwi (1≤wi1≤wi ). The graph is connected, i. e. for any pair of vertices, there is at least one path between them consisting only of edges of the given graph.
A minimum spanning tree (MST) in case of positive weights is a subset of the edges of a connected weighted undirected graph that connects all the vertices together and has minimum total cost among all such subsets (total cost is the sum of costs of chosen edges).
You can modify the given graph. The only operation you can perform is the following: increase the weight of some edge by 11 . You can increase the weight of each edge multiple (possib