PCJ18A code goes wrong

Hello, My code with ID 19781133 for PCJ18A is showing wrong, can anyone please help me find out the problem?

You are breaking out of the input loop and thus not completing the input for the current test case. This will result in the input of the current test case to be transferred to the next one, leading to a wrong answer.

I did not understand, as I debugged it did not break out of the input loop and it did complete the input for the ongoing case. Can you please type the correction in the same piece of code? Thanks for the help.