How to solve using sqrt Decomposition?

Problem link:SPOJ.com - Problem DQUERY

This problem can be solved with Mo’s algorithm. But can anyone please tell me how to solve this problem using square root decomposition??