spoj-WA in CNEASY

, , , , ,

The link to my code is http://ideone.com/sWkesO
I am not able to understand why my code is showing wrong answer.