DRANGE wrong answer

can anyone fix my code. http://www.codechef.com/viewsolution/2414752
The link to the problem : http://www.codechef.com/problems/DRANGE/
thanks in advance.