this is my solution http://ideone.com/5i1hV2 for the problem
https://www.codechef.com/LTIME16/problems/CHEFB
in this problem i am getting TLE whn n<=100000 and array size<=1000000
could anyone say meatho of optimising it and getting AC
thanks in advance