Problem from codeforces

I am not able to find the bug please guys help me