Kindly tell what's wrong

i have not seen the soln, my code passes all the test cases given on spoj as examples but gives WA when submitted
code:
https://ide.codingblocks.com/s/476405

prob: