Bakayev E.B.

In each cell of a strip of length 100, there is a chip. For 1 ruble, you can swap any two adjacent chips, 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 parity, while a paid operation changes the parity of two chips. Therefore, at least 50 rubles will be required.

Algorithm. We will number the chips in order from 0 to 99. We will color the cells in four colors: $a b c d a b c d . . . d$. A free operation changes 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.

The map of Quadriland is a $6 \times 6$ grid of cells. Each cell is either a kingdom or a disputed territory. There are 27 kingdoms and 9 disputed territories. A disputed territory is claimed by all neighboring kingdoms and only by them (i.e., cells adjacent to the disputed territory by a side or a vertex). Is it possible that each pair of disputed territories is claimed by a different number of kingdoms?

## Solution

The diagrams below show examples of Quadriland. Empty cells are kingdoms, and the number in a cell indicates how many kingdoms claim that disputed territory.

| 0 |  |  | 3 |
| :---: | :---: | :---: | :---: |
| 1 | 4 |  |  |
|  | 5 |  |  |
|  | 6 |  |  |
|  | 7 | 8 |  |
|  |  |  |  |

![](https://cdn.mathpix.com/cropped/2024_05_06_dbba6af20ebd45cbbb54g-20.jpg?height=314&width=1120&top_left_y=452&top_left_x=662)

## Answer

It is possible.