Doubt on this question

While solving this question on codeforces- https://codeforces.com/problemset/problem/1284/B But got WA on TC 21. Here’s the submission link- https://codeforces.com/contest/1284/submission/68203463
Can someone explain, where this is wrong.

ssjgz can you please help