editorial of rectangular queries (dec long challenge)

anyone please explain solution of rectangular queries of dec long challenge…
as soon as possible

You can have a look at this question for detailed understanding…

editorial : http://discuss.codechef.com/questions/31830/rectquer-editorial

Also have a look at this explanation by anonymousins:

http://discuss.codechef.com/questions/32905/rectangular-queries-logic-unveiled