You are the owner of SmallCableCo and have just bought the franchise rights for a small town. Unfortunately you do not have enough money to start the business properly, so you are relying on parts you found in an old warehouse you purchased. Among your finds is a single spool of cable and a large pile of connectors.
You want to work out whether you have enough cable to connect every house in town. You have a map of the town listing every path you may use to run cable between houses, together with the distance of each path. Compute the shortest total length of cable you need in order to connect all of the houses together.
Only one town is given in the input.
houseA houseB distance. The two house names match two different names in the list above, and the distance is a positive real number. No two paths connect the same pair of houses.The output consists of a single line.
If there is not enough cable to connect all of the houses in the town, output
Not enough cable
If there is enough cable, output
Need <X> miles of cable
where $X$ is the shortest total length of cable needed to connect all of the houses, printed to the nearest tenth of a mile (0.1).