Range-max segment tree with lazy propagation. Lazy defers range updates — instead of pushing a change to every node immediately, it stores a pending value and propagates it only when a node is actually visited.
① Set a range → ② Run Query or Update → ③ Step through with ← → keys (or buttons)