Wrong answer for CHEFGR question ?

hi
i am getting wrong answer for this question while my answer is correct as i have checked it for all test cases and other cases also. please help me with this.
thank you

Hi @awasthiharsh! It isn’t possible that you get WA for submitting correct code, there must be some flaw. Also, the test cases for this problem are weak, so if your code is even a bit correct, it must work. Please check for a simple way to calculate things. Hint: Don’t think of complex test cases! :wink: