DYNAMO Video Solution

Here it is: https://youtu.be/lOMNRqAo7pc
Commented code: https://www.codechef.com/viewsolution/28941016
Similar game theory problem:
https://math.stackexchange.com/questions/2254245/single-pile-nim-proof-by-induction
https://en.wikipedia.org/wiki/Nim#The_subtraction_game_S(1,2,...,_k)
Comments, questions, requests, criticism, are all welcome!