SIGTSTP error for MULTHREE problem Java

Hello,

I am getting SIGTSTP error with the test input 3 for the below problem (MULTHREE):

My code works well for the first two test inputs.

Here is the code I have attached:
https://www.codechef.com/viewsolution/39959901

Thank you