Senplosion ---------- You are housing manager of the Quorzup habitat orbiting the sun Q5874 in the Goose Down spiral of the galaxy. Quorzup consists of many hubs connected by tubes. You have been asked to accept a ship full of Sensites who will be staying permanently. The hubs have many empty living modules so space per se is not a problem. However, if two Sensites get too close to one another, aromas they give off mix and cause a senplosion that makes everyone nearby very, very uncomfortable. So there are rules: (1) No two Sensites may live in the same hub. (2) No two Sensites may live in two hubs that are directly connected by a single tube. You need to find out quickly how many Sensites your habitat can house. Input ----- For each test case, first a line that gives the test case name. Then a line of the form N giving the number of hubs in the habitat. This is followed by N hub description lines each of the form X Y Z giving the location (X,Y,Z) of the hub relative to the habitat center. Hubs are given identifiers 1, 2, 3, ..., N in the order of their description line. Lastly there are N-1 tube description lines each of the form I J specifying that the tube connects hub I directly to hub J. The habitat builders designed the habitat to minimize the total length of all the tubes while also providing that any hub is reachable from any other hub by some path through tubes and other hubs. 2 <= N <= 100,000 -1,000,000 <= X,Y,Z <= +1,000,000 Input terminates with an end of file. The test case name line is at most 80 characters. Output ------ For each test case, first an exact copy of the test case name line. Then a line containing just the maximum number of Sensites the habitat can accommodate while obeying the rules. Sample Input ------ ----- -- SAMPLE 1 -- 9 -200 0 0 -100 0 0 0 -50 -50 0 50 -50 0 -50 50 0 50 50 0 0 0 100 0 0 200 0 0 7 3 7 4 7 5 7 6 2 1 7 2 8 7 9 8 -- SAMPLE 2 -- 12 -200 0 0 -200 50 50 -200 50 -50 -200 -50 -50 -200 -50 50 -100 0 0 100 0 0 200 -50 -50 200 -50 50 200 50 50 200 50 -50 200 0 0 2 1 3 1 4 1 5 1 12 8 12 9 12 10 12 11 6 1 12 7 7 6 Sample Output ------ ------ -- SAMPLE 1 -- 6 -- SAMPLE 2 -- 9 File: senplosion.txt Author: Bob Walton Date: Sat Oct 7 14:10:44 EDT 2017 The authors have placed this file in the public domain; they make no warranty and accept no liability for this file.