why getting a NZEC error

I tried to solve a problem at school level named URCALC using java and it shows right answer using custum input but give a runtime error on run time on IDE.Please tell me what is my mistake else than using try catch block.
link text