i am getting NZEC without try catch and its not this problem it is happening in many problems when i write the same code in c++ i get AC but in java same logic is giving WA every time. moreover i have noticed i am not alone as lot of people complained about this in comments . Any idea what i am doing wrong?
edit: Only two people have solved this in java spoj.com/ranks/FANCY/lang=java
Few Comments under the problem: