## Task B-3.2.

Ana, Bruno, Cvita, Dino, and Ema are trying to arrange themselves in five seats in a row. In how many ways can they do this if Ana does not want to sit next to either Bruno or Cvita, and Dino does not want to sit next to Ema?
## First Solution.

Let's denote the people in the problem by the first letter of their names. First, we choose two positions for D and E from positions 1, 2, 3, 4, or 5, and then we will place A, B, and C on the remaining three positions.

D and E should be placed in such a way that three consecutive positions are not left for A, B, and C, as this would force A to sit next to B or C, which is not allowed according to the problem's conditions. Therefore, the only positions for (D, E) are (1, 3), (1, 4), (2, 4), (2, 5), and (3, 5):

| $\mathrm{D}$ |  | $\mathrm{E}$ |  |  |
| :---: | :---: | :---: | :---: | :---: |
| $\mathrm{D}$ |  |  | $\mathrm{E}$ |  |
|  | $\mathrm{D}$ |  | $\mathrm{E}$ |  |
|  | $\mathrm{D}$ |  |  | $\mathrm{E}$ |
|  |  | $\mathrm{D}$ |  | $\mathrm{E}$ |

Similarly, we can choose 5 positions for (E, D), which totals 10 positions for this pair of people. 2 points In each of these 10 cases, except for two when (D, E) or (E, D) are at position (2, 4), B and C must be placed on two consecutive positions, and this can be done in two ways: (B, C) or (C, B).

$\mathrm{U}$ In these eight cases, there are a total of $8 \cdot 2=16$ possibilities for arranging the people A, B, C, D, and E.

If (D, E) or (E, D) are at position (2, 4), person A can be placed in 3 ways, person B in 2 ways, and person C in 1 way on the remaining three positions.

This means that in this case, there are a total of $2 \cdot 3 \cdot 2 \cdot 1=12$ arrangements of the people A, B, C, D, and E.