COOKGAME-GETTING WA

my code:https://www.codechef.com/viewsolution/14314802

problem link:https://www.codechef.com/problems/COOKGAME
please help me fix the error

1 Like

Your logic seems pretty much correct to me. Can you try changing all variables in the “pow” function to long long int? I suspect that its an overflow error happening here. Get back to me with results ^^

1 Like

yes it worked…Thanks… :slight_smile:

Glad it worked. I saw you tried alot for that problem :slight_smile: