Company: Cisco_8th june_on campus
Difficulty: medium
Distributed Task Tour on a Server Tree A distributed system contains tree_nodes servers numbered from 1 through tree_nodes . The servers form a tree: there are exactly tree_nodes - 1 bidirectional edges, and moving across one edge takes one unit of time. A process starts at server start_node . It must visit every server in task_nodes (in any order) and finally finish at server end_node . Servers and edges may be visited more than once. Find the minimum total time required. Input Format The first line contains tree_nodes . The second line contains tree_nodes - 1 integers: tree_from . The third line contains tree_nodes - 1 integers: tree_to . For every index i , there is an edge between tree_from[i] and tree_to[i] . The fourth line contains start_node and end_node . The fifth line contains num_tasks . The sixth line contains num_tasks integers: task_nodes . Output Format Print one integer: the minimum time needed to start at start_node , visit every task server, and end at end_node . Con