I was not able to solve this problem during the contest and then I solved the problem in practice section.
I found some other submission same as I did but I got 40 points only and that person got 100 points for the same logic.
Then I decided to submit the same code ( as submitted by that user ) in the practice section ( I hope submitting code of some other user in practice is not considered wrong ) but still I have got 40 points for the same.
Do the code judged on different test cases during contest and in practice ?
Below is the link to code which got 100 points during contest time.
https://www.codechef.com/viewsolution/18668743
And here is the link to the same code which has got 40 points during practice time.