2 Mathematically Identical Solutions, one is AC other is WA
I was trying to solve this question.
First I wrote this solution which got WA.
Then after checking other already AC solutions I changed the solution to this which got AC.
Both solutions look mathematically identical to me.
Can anyone please explain to me where I am wrong?
CodeChef Starters 136 Solution Discussion
CF Edu Round 166 Solution Discussion