Here's a challenge to test your understanding: Given a tree, support these operations:
Add to all nodes on path from to
Query sum of values in subtree of This requires combining HLD (for path updates) with Euler tour (for subtree queries). Here's the trick: use HLD to handle path updates, but store values in Euler tour order so subtree queries are ranges. Think about how the data structures interact before looking up solutions. Time: . Space: .