Important lessons:
Coordinate compression is often needed when values are large but the number of distinct values is small
The order of while loops in MO's matters: expand before shrinking to avoid negative range issues
Store the original query index to output answers in the correct order MO's algorithm works whenever you can efficiently add/remove single elements. What about problems where add/remove isn't ?