Consider a two player game in which the players take turns breaking up an NxM block of chocolate. On a players turn, they select one existing block of chololate and break it in a straight line along one of its break lines making two smaller blocks of chocolate. The players alternate turns, selecting a single block and breaking it into two smaller blocks. If on a players turn they have no legal moves (because there are only 1x1 blocks left), they lose. Determine the optimal strategy and who will be the winning player from a starting NxM position.
To clarify, a legal move is to select an available NxM block, then select a positive integer k less than N or a positive integer i less and M and turn that NxM block into either a (N-k)xM block plus a kxM block, or into a Nx(M-i) block plus a Nxi block. To give some examples, in the 1x1 case the first player loses (having no legal moves), and in the 1x2 case the first player wins (by making the only legal move).