SPOJ JAVAC WA

,

SPOJ.com - Problem JAVAC. Hello I am getting wrong answer. I dont know where I am going wrong as I have exhausted all test cases on forums and they are coming out correct. Here is the link to the solution.
UUc0fN - Online C Compiler & Debugging Tool - Ideone.com . All help is appreciated. Thanks.