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.