5. There are 2009 piles, each containing 2 stones. It is allowed to take the largest pile from those in which the number of stones is even (if there are several, then any of them), and move exactly half of the stones from it to any other pile. What is the maximum number of stones that can be obtained in one pile using such operations?
Answer: 2010. Solution. The operations described in the condition do not reduce the numbers of stones in the heaps, so at any moment, there is at least one stone in each of them. Therefore, it is impossible to accumulate more than $2009 \cdot 2$ $2008=2010$ stones in one heap.

We will show how to obtain a heap with 2010 stones. Take five heaps of two stones each and perform the following transformations: $(2,2,2,2,2) \rightarrow(3,1,2,2,2) \rightarrow$ $(3,1,3,1,2) \rightarrow(3,1,4,1,1) \rightarrow(5,1,2,1,1)$. Set aside three heaps of one stone each, replace them with three heaps of two stones each, and perform the following transformations: $(5,2,2,2,2) \rightarrow(5,1,3,2,2) \rightarrow(5,1,4,1,2) \rightarrow(7,1,2,1,2)$. Now set aside two heaps of one stone each, replace them with two heaps of two stones each, and similarly obtain $(9,1,2,1,2)$. When the large heap accumulates 2007 stones, there will still be three heaps of 2 stones and 2005 heaps of one stone. Proceed as follows: $(2007,2,2,2) \rightarrow(2007,1,3,2) \rightarrow(2007,1,4,1) \rightarrow(2009,1,2,1) \rightarrow$ $(2010,1,1,1)$.

Grading instructions. Only the answer - 0 points. The answer with a proof that there can be no more than 2010 stones in one heap, but without an example of how to get 2010 - 2 points. The answer with a justified example, but without a proof that more than 2010 stones in one heap is impossible - 4 points.