As part of the preparation for the olympics held in the IOI country in 20XX, JOI park is going to be renovated. JOI park has N squares, numbered 1 to N. The park also has M roads that join the squares, numbered 1 to M. Road i (1≤i≤M) joins square Ai and square Bi in both directions, and its length is Di. From any square you can reach every other square by following roads.
The renovation plan goes as follows. A value C for the subway construction is given. First, pick an integer X that is at least 0 and join by subway every square whose distance from square 1 is at most X, square 1 included. The distance between square i and square j is the smallest sum of road lengths over the routes from square i to square j. The subway construction costs C×X in total.
Next, tear down every road that joins two squares linked by the subway. Tearing down a road is free.
Finally, repair every road left standing. Repairing a road of length d costs d.
JOI park has no subway before the renovation starts. Given the squares and roads of JOI park together with the value for the subway construction, write a program that computes the smallest cost of renovating JOI park.
Standard input holds the following information.
Print the smallest cost of renovating JOI park on one line.