Shapovalov A.V.

The dragon imprisoned the knight and gave him 100 different coins, half of which are magical (which ones exactly - only the dragon knows). Every day, the knight sorts all the coins into two piles (not necessarily equal). If the piles end up with an equal number of magical coins or an equal number of ordinary coins, the dragon will release the knight. Can the knight guarantee his freedom no later than

a) on the 50th day

b) on the 25th day

#
b) First, we will divide the coins into two piles: the first pile with 49 coins, and the second with 51. Then, each day we will move one coin from the first pile to the second. On the 25th day, the first pile will have 25 coins, and the second pile will have 75. Therefore, on the 25th day, the first pile will have no more than 25 fake and no more than 25 genuine coins. If the same situation was true on the first day, then either the fake or genuine coins in the first pile were exactly 25 (otherwise, there would be no more than 48 coins in total), and the knight would have been freed immediately. Otherwise, on the first day, the first pile had more than 25 fake or more than 25 genuine coins. Note that the number of both fake and genuine coins in the first pile can change by no more than 1 each day compared to the previous day. Therefore, on some day between the first and the 25th, the number of fake or genuine coins in the first pile will be 25, as required.

## Answer

He can.