Dsa
Trees
Medium
The Fission Point
You are a cloud architect tasked with splitting a server cluster (tree) into two separate clusters by removing exactly one connection. Each node has a 'Load' value. You want to choose an edge to remove such that the maximum load of the two resulting clusters is minimized. Total load of a cluster is the sum of loads of all its nodes.
Input Format:
- Line 1: N (number of nodes).
- Line 2: N integers (load of each node 0 to N-1).
- Next N-1 lines: Two integers u and v (an edge).
Output Format:
- The minimum possible value of the maximum load between the two split clusters.
Example:
Input:
3
10 20 30
0 1
1 2
Output:
30
Explanation: Removing (0,1) gives sums {10} and {50}, max is 50. Removing (1,2) gives sums {30} and {30}, max is 30.
Key concepts
treesubtree sumgraph partitioning
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now