How do you usually implement HLD?
Do you flatten the tree by DFS (prioritizing the heavy child) and use a single segment tree over the whole array,
or build a separate segment tree for each chain?
CF Edu Round 173 Solution Discussion