Company: virtusa_17oct
Difficulty: medium
Equal Biomass Partition Problem Description Emma is studying a model of ecological biomass distribution in a forest ecosystem. The forest is modelled as a tree with N habitat blocks, numbered 0 to N - 1 , where each block contains a certain amount of biomass. The entire ecosystem is connected by undirected paths, forming a tree (a connected, acyclic graph). Emma wants to cut exactly one path so that the two resulting disconnected forest parts have equal total biomass. Your task is to determine which path can be removed to achieve this equal partitioning. Compute the biomass sum of each subtree and identify a valid cut, if one exists. If more than one path can be cut to achieve the equal partitioning, return the smallest pair lexicographically. If no such path exists, return [-1, -1] . Input Format Read from standard input: The first line contains an integer input1 — the number of blocks, N . The second line contains N integers, the array input2 , where input2[i] is the biomass of block