4. In how many ways can two knights, two bishops, two rooks, a queen, and a king be arranged on the first row of a chessboard so that the following conditions are met:
1) The bishops stand on squares of the same color;
2) The queen and the king stand on adjacent squares. (20 points).
# Solution:

Let's number the cells of the first row of the chessboard in order from left to right with numbers from **1** to **8** ( **1** - the first white cell, **8** - the last black cell). Since the queen and king are standing next to each other, they can occupy one of 7 positions: 1-2, 2-3, ..., 7-8. Additionally, on each position, we can swap their places (for example, on position 1-2, we can place the king first, then the queen, and vice versa). In total, we have 2$\cdot$7=14 ways to place the queen and king on the first row of the chessboard so that they stand next to each other. Now let's see how we can place the bishops. Suppose we have placed the queen and king somewhere (for example, on positions 4-5). Notice that no matter how we place the queen and king, we will have 3 cells of each color left: 3 white and 3 black. To place the bishops, we need to choose the color of the cell - this gives us 2 options. Then we have 3 positions on which we want to place two bishops (the number of combinations of 3 taken 2 at a time). This can be done in 3 ways. Therefore, we have $2 \cdot 3=6$ ways to place the two bishops on cells of the same color given a fixed position of the king and queen. We have 4 cells left, on which we need to place two knights and two rooks. That is, we need to choose 2 positions out of 4 for the rooks, and the knights will take the remaining 2 positions. We can choose 2 cells out of 4 in 6 ways (the number of combinations of 4 taken 2 at a time). Therefore, we have 6 ways to place the two rooks and two knights on 4 positions in any order. Since we fixed the positions sequentially, the multiplication rule applies. The total number of ways to place the figures is $N=14 \cdot 6 \cdot 6=504$.

## Answer: 504.

| Points | Criteria for evaluating the completion of task № 4 |
| :---: | :---: |
| 20 | A correct and justified sequence of all steps of the solution is provided.  All transformations and calculations are performed correctly.  The correct answer is obtained. |
| 14 | A correct sequence of all steps of the solution is provided.  There are gaps in the justification of the number of ways to arrange the figures  (for example, rooks and knights), or the distinguishability of figures in one pair, or  a computational error or typo that does not affect the further course of the solution.  As a result of this error or typo, an incorrect answer may be obtained. |
| 7 | The problem is not solved, but its solution is significantly advanced, i.e.:  - a significant part of the solution is performed correctly, possibly inaccurately (for example,  the number of ways to arrange the king, queen, and either only the bishops  or only the rooks and knights; the problem is solved separately only with condition №1 and  only with condition №2);  - the other part is either not performed or performed incorrectly, possibly even with  logical errors (for example, the number of ways to arrange only the rooks and knights or only the bishops).  The solution may be incomplete. |
| 0 | All cases of the solution that do not meet the above criteria  for scoring 7 and 14 points. |