Bakayev E.V.

In each cell of a strip of length 100, there is a chip. You can swap any two adjacent chips for 1 ruble, and you can also swap any two chips that have exactly three chips between them for free. What is the minimum number of rubles needed to rearrange the chips in reverse order?
Evaluation. Each chip must change the parity of its number. A free operation does not change the parity, while a paid operation changes the parity of two chips. Therefore, at least 50 rubles will be required.

Algorithm. Number the chips in order from 0 to 99. Color the cells in four colors: $a b c d a b c d . . . d$. A free operation swaps chips in adjacent cells of the same color. Therefore, chips in cells of the same color can be freely rearranged in any order. We will swap chips in all pairs $b c$ and $d a$ - this is 49 paid operations. In cells of color $b$ and $c$, the chips can already be arranged as needed for free. In cells of color $a$ and $d$, we will arrange the chips so that chips 0 and 99 are next to each other. We will swap them with the last paid operation and then arrange all the chips in the required order.

## Answer

For 50 rubles.