Typing(practice school)

https://www.codechef.com/viewsolution/21439159
What could be possibly wrong in this code. I believe to have implied all the test cases.
Please take a look into the code.