5. The cells of a $9 \times 9$ board are painted in black and white in a checkerboard pattern. How many ways are there to place 9 rooks on the same-colored cells of the board so that they do not attack each other? (A rook attacks any cell that is in the same row or column as itself.)
Answer: $4!5!=2880$.

Solution. Let the upper left corner of the board be black for definiteness. Note that black cells come in two types: cells with both coordinates even, and cells with both coordinates odd. If a rook is on a black cell with both even coordinates, then all black cells it attacks also have even coordinates. Similarly, a rook standing on a black cell with both odd coordinates attacks only black cells with both odd coordinates. Therefore, we need to count the number of ways to place 9 rooks on two boards: $4 \times 4$ and $5 \times 5$ (a board consisting only of black cells with both even coordinates, and a board consisting only of black cells with both odd coordinates). For the first board, this number is 4!, and for the second, it is 5!. Therefore, the total number of ways to place the rooks on black cells is $4!5!=2880$.

Now let's show that it is impossible to place 9 rooks on white cells in the required manner. Consider the cells whose first coordinate is odd and the second is even. No more than four rooks can be placed on such cells, as they are contained in four rows. Similarly, no more than four rooks can be placed on white cells whose first coordinate is even and the second is odd, as they are contained in four columns.