Why is this code not working for this problem?

Why is this code not working for this problem?

http://codeforces.com/problemset/problem/230/B

hi aryan,
Your logic is not right for this question,
Try to dry run your code for 625.
Please let me know if you know hint for the question.

Sorry Sir .
I just thought of it for the basic input.

Yes Can You Please tell me the hint for this Question?