Given an array of size initialized to 0, perform operations:
add(l, r, val): Addvalto all elements in rangequery(l, r): Return sum of elements in range This requires lazy propagation because:
Range updates would be with point updates
You need both range updates and range queries Implement a segment tree with lazy propagation for range add and range sum. Constraints: up to , up to operations.