GAME THEORY 3 n piles reduce to a/b each

have a look into my code and suggest changes https://ide.codingblocks.com/s/183013
and also explain how this is keeper loosers both the above qns game theory1 and 2 are winner keepers and how this is keeper loosers.

This is a DP + Game Theory + Factorisation based question. You need to completely rethink your approach. If you fail to do so, then I would be happy to suggest you the approach.

So i have to study dp and then cane back here?

I’ll advise you yes. Get a little experience with DP before attempting it again.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.