$\underline{\text { Kanel-Belov A.Y. }}$

There is one red and $k(k>1)$ blue cells, as well as a deck of $2 n$ cards, numbered from 1 to $2 n$. Initially, the entire deck lies in a random order in the red cell. From any cell, you can take
the top card and move it either to an empty cell or on top of a card with a number that is one greater. For what largest $n$ can the entire deck be moved to one of the blue cells using such operations?
Let's construct an example showing that when $n \geq k$ it is impossible. Suppose the cards (from top to bottom) are initially arranged as follows: first all the odd-numbered cards (in any order), followed by the even-numbered cards, with the top one being card $2n$. Then the first $k$ moves are uniquely determined - the odd-numbered cards are moved to free positions; the next move, if $n > k$, is impossible, and if $n = k$, the only move is to place card $2n-1$ back into the original stack, which is meaningless because we return to the previous position. Therefore, this stack cannot be moved.

Now, let's show how the process of moving can be organized when $n < k$.

We will divide all the cards into pairs $(1,2), (2n-1,2n)$ and assign each pair to an unoccupied cell (at least one cell is not assigned to any pair; let's call it a free cell).

Now, we will try to place each card from the top of the red cell into its assigned cell. This may not be possible only if the card has number $2i$, and card $2i-1$ is already in the cell; but then we can move card $2i$ to the free cell, place card $2i-1$ on top, assign this cell to our pair, and call the previously assigned cell free. Thus, in the end, we will have the cards arranged in cells by pairs. Now, using the free cell, it is easy to collect them into a deck in the correct order.

## Answer

When $n = k-1$.