Link to the problem : https://www.codechef.com/MAY19B/problems/MATCHS

I *need help in understanding how the players play the moves* .

The problem statement mentions that the players play ‘**Optimally**’ . I did not get a clear Idea from this .

**I am asking this because I found cases where a change in one player’s move changes the outcome.**

For example , consider the number of matches in **heap A = 36** and **heap B =10 .**

Note here the *starting player will have three options to play* :

1)Remove 10 from A

2)Remove 20 from A

3)Remove 30 from A

**Considering cases (1) and (2)** ;

Please notice that both the cases **CAN** Lead into different outcomes .

I would appreciate if someone could make this clear if I have incorrectly percieved something .

I hope I could convey things effectively . Any suggestions / advices would be appreciated !

Thanks !