Company: Tekion_4aug
Difficulty: medium
Maximum Efficiency Problem Description Given a network of n computer systems represented as a rooted tree (with the master computer as the root). The problem describes the tree structure using two arrays, connect_from[] and connect_to[] . Each pair connect_from[i] , connect_to[i] represents an undirected edge between two computers. Each computer has a value assigned to it, represented by the array computer_val[] . For the purpose of subtree operations, it is implied that node 0 is the root of the tree. To maximize the network's throughput, inefficient systems can be removed. In one operation, any computer node u and all nodes in its subtree can be removed. The number of such operations applied is denoted as num_ops . For a given parameter k , the efficiency of the network after num_ops operations is calculated as: (sum of values of all remaining computer nodes) - k * num_ops . Determine the maximum possible efficiency when applying some (possibly zero) operations optimally. Note: The n