Recently, I was solving this problem on Codeforces, but I failed the testcases. I can\'t see the testcases, nor can I see other\'s solutions because it is a gym question. S