why i am getting a wrong answer ?

http://www.codechef.com/DCL1501/problems/DCL2015B
My Solution :- http://www.codechef.com/viewsolution/6422703