Hello everyone,

I was trying this problem : Click

I couldn't get any idea. So, read the editorial.

It mentioned to *square root decompose* the queries and then solve the problem. I don't really get the idea behind it.

can someone, please explain?

**P.S.**: I know about SQRT decomposition