Unable to understand the error in my solution.

I am getting a runtime error in the solution CodeChef: Practical coding for everyone of the problem chef and science problem