{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"You are the owner of SmallCableCo and have purchased the franchise rights for a small town. Unfortunately, you lack enough funds to start your business properly and are relying on parts you have found in an old warehouse you bought. Among your finds is a single spool of cable and a lot of connectors. You want to figure out whether you have enough cable to connect every house in town. You have a map of town with the distances for all the paths you may use to run your cable between the houses. You want to calculate the shortest length of cable you must have to connect all of the houses together."}},{"title":"Input","value":{"format":"HTML","content":"Only one town will be given in an input.\r\u003cbr\u003e\u003cul\u003e\u003cli\u003eThe first line gives the length of cable on the spool as a real number.\r\u003cbr\u003e\u003c/li\u003e\u003cli\u003eThe second line contains the number of houses, N\r\u003cbr\u003e\u003c/li\u003e\u003cli\u003eThe next N lines give the name of each house\u0027s owner. Each name consists of up to 20 characters {a–z,A–Z,0–9} and contains no whitespace or punctuation.\r\u003cbr\u003e\u003c/li\u003e\u003cli\u003eNext line: M, number of paths between houses\r\u003cbr\u003e\u003c/li\u003e\u003cli\u003enext M lines in the form\u003c/li\u003e\u003c/ul\u003e\r\u003cbr\u003e\u0026lt; house name A \u0026gt; \u0026lt; house name B \u0026gt; \u0026lt; distance \u0026gt;\r\u003cbr\u003eWhere the two house names match two different names in the list above and the distance is a positive real number. There will not be two paths between the same pair of houses."}},{"title":"Output","value":{"format":"HTML","content":"The output will consist of a single line. If there is not enough cable to connect all of the houses in the town, output\r\u003cbr\u003eNot enough cable\r\u003cbr\u003eIf there is enough cable, then output\r\u003cbr\u003eNeed \u0026lt; X \u0026gt; miles of cable\r\u003cbr\u003ePrint X to the nearest tenth of a mile (0.1)."}},{"title":"Sample","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e100.0\r\n4\r\nJones\r\nSmiths\r\nHowards\r\nWangs\r\n5\r\nJones Smiths 2.0\r\nJones Howards 4.2\r\nJones Wangs 6.7\r\nHowards Wangs 4.0\r\nSmiths Wangs 10.0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNeed 10.2 miles of cable\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}