JAVA nzec help

I am trying to solve this problem.Here is my solution with java.I am getting an NZEC but I am not really throwing any exception or dividing by zero in my solution.Any help is appreciated.

Main class should be in default package and should be public.

??

//