Your output should consist of pairs of hometrees in the same order as in the input, followed by the length of the shortest path between them that collects each type of fruit exactly once. If such a path does not exist, you should output “NONE”.
In the first example below, the path a -> b -> c -> d collects all the fruit types (1, 2, 3, and 5) and the path has length 4.0. No good path exists between a and c, however: the path a -> b -> c -> d -> c would collect all the fruit types, but it collects fruit 1 twice!