GAME THEORY sprague grundy theorem

I was going through a problem of game theory from gfg. I guess it is some sort of variation of grundy theorem. But I am not able to figure it out , please help…

problem :
https://practice.geeksforgeeks.org/problems/game-of-chocolates/0

hi @shahpankti931
This is called the Wythoff’s game. Resources for this:

http://www.cut-the-knot.org/pythagoras/withoff.shtml
https://en.wikipedia.org/wiki/Wythoff's_game

solution based on the above articles : https://ide.geeksforgeeks.org/3lBGNLffht

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.