October Long Challenge - MSNG - WA in second subtask

I’ve tried every possible test case that I could think of, can anyone please tell me why I’m getting wrong answer for second test case?

My solution:
https://www.codechef.com/viewsolution/27367501