problem link:- http://codeforces.me/problemset/problem/221/D i have used mo's algorithm and my complexity fits in given time limit.. but still i am getting TLE on test 5.. please help.. my submission:- http://codeforces.me/contest/221/submission/18995087