NZEC error in Java code.Please help!

I am getting a NZEC error to my solution which runs fine in my pc.
Please help as i have tried hard but was not able to find the error causing code.
The link to the problem is KNPSK Problem - CodeChef
The link to my solution is CodeChef: Practical coding for everyone
Waiting for any help eagerly.
Thank you.