help needed in codeforces problem E??

i understood this problem but constraints for l and r are very the editorial they have somehow reduced the upper_bound on l,r to 6e5 which i cant understand how.

looks like co-ordinate compression to me so they can apply difference array approach though.

please explain in detail.

Problem link: