i dont understand why my soln. is wrong??Plz help me. I m stucked past 2 days.

Check my soln CodeChef: Practical coding for everyone
Please answer clearly.

The link U are providing does not provide ur solution.Can u give another link

U can see the editorial of the problem “SPLST - Editorial - editorial - CodeChef Discuss

I guess u are going wrong with the condition part.

check it now CodeChef: Practical coding for everyone