Number of Good Service Paths
You manage the routing layer of a distributed platform. The service topology is a tree: `n` services numbered from `0` to `n - 1`, connected by exactly `n - 1` undirected links, with every pair of services reachable and no cycles. Service `i` runs at an integer load level given by `loads[i]`.