URAL 1639. Chocolate 2

Little Boy is mad at Karlsson, who ate all the sweets in the flat and even went to the neighbours to eat their sweets too. Now Little Boy’s parents brought home a chocolate bar, and, sure enough, Karlsson is here already and wants to eat it. However, this time Little Boy has firmly decided that not a single piece of chocolate will go to this glutton. Little Boy wants to use Karlsson’s addiction to the games of chance and suggests playing the following game. A chocolate bar can be considered as a rectangle of square “units” arranged inmrows andncolumns and separated by “lines”. Two players take alternate turns. At his turn, a player must take one piece of chocolate and split it into two along one of the lines. If a player can’t make a legal move (which happens when all pieces of chocolate consist of a single unit square), he loses, and the winner takes all the chocolate.

,积极的人在每一次忧患中都看到一个机会,

URAL 1639. Chocolate 2

相关文章:

你感兴趣的文章:

标签云: