Katka had five beds arranged as shown in the picture in her garden. She wanted to plant garlic, carrots, and radishes in such a way that each bed would contain only one type of vegetable and no two beds with the same vegetable would be adjacent.

In how many ways could Katka plant the beds?

(L. Hozová)

![](https://cdn.mathpix.com/cropped/2024_04_17_96587d6cc949a3c812fag-3.jpg?height=272&width=516&top_left_y=912&top_left_x=770)
We will mark the beds with the same vegetables with the same letter, and beds with different vegetables with different letters. To ensure that beds with the same vegetables do not neighbor each other, they must be planted as follows:

| $A$ |  | $B$ |  |
| :--- | :--- | :--- | :---: |
| $B$ | $C$ | $A$ |  |

Katka can plant the beds marked $A$ with any of the three crops, the beds marked $B$ with any of the remaining two crops, and the bed marked $C$ with the last remaining crop. Therefore, Katka can plant the beds in $3 \cdot 2=6$ ways.

Note. All possible assignments of crops to the beds are listed here:

| garlic | A | A | C | C | B | B |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| carrot | B | C | A | B | C | A |
| radish | C | B | B | A | A | C |

If garlic is on bed $A$, then carrot can be on bed $B$ or $C$, and radish on the remaining bed. This process exhausts all $3 \cdot 2=6$ possibilities. Any two adjacent columns in the table differ by the swapping of two letters, and no column is repeated.

In a gardeners' community, Mr. Jahoda had 16 liters of water in his barrel. His neighbor, Mr. Malina, had three times as much water in his barrel. It started raining, and the same amount of water fell into both barrels. After the rain, Mr. Malina found that he had twice as much water in his barrel as Mr. Jahoda.

How many liters of water fell into each barrel?

(L. Hozová)