You are given a tree where each node has a value. Process two types of queries:
Change the value of node s to x (update query).
Find the maximum value on the path from node a to node b (path query).
There are up to , nodes and , queries mixed together. Updates and path queries can be interleaved. This requires a data structure that handles both path queries and point updates efficiently. Heavy-light decomposition with a segment tree is the standard approach.