Company: Cisco_8th june_on campus
Difficulty: medium
A distributed system of servers is represented as a tree with tree_nodes nodes, numbered from 1 to tree_nodes . The tree has exactly tree_nodes - 1 edges, and moving between two directly connected servers takes 1 unit of time. Edges are bidirectional. A process must: Start at the start_node server. Complete a task at every server listed in the array task_nodes[] of size num_tasks , visiting them in any order. Finish at the end_node server. The process moves one edge at a time and may revisit servers and edges as many times as needed. Determine the minimum total time required to start at start_node , complete all tasks, and end at end_node . Note: The given graph is always a tree (connected, with exactly tree_nodes - 1 edges). Edges are bidirectional. task_nodes[] contains distinct elements. start_node is not equal to end_node , and start_node is not present in task_nodes[] . Input format The program reads from standard input: The first line contains a single integer tree_nodes . The se