Doubt on this question

While solving this question on codeforces- Problem - 1284B - Codeforces But got WA on TC 21. Here’s the submission link- Submission #68203463 - Codeforces
Can someone explain, where this is wrong.

ssjgz can you please help