## Task A-4.3.

Let $n \geqslant 2$ be a natural number. Two opposite corner squares have been removed from an $n \times n$ board. In how many ways can $n$ figures be placed on this board such that no two are in the same row or column?
## First Solution.

Consider a standard (i.e., with no corner fields removed) board of dimensions $n \times n$. The two opposite corner fields that should be removed are colored black, and all other fields are colored white.

A good arrangement is an arrangement of $n$ figures on the standard board in which no two figures are in the same row or column. We need to determine the number of different good arrangements such that no figure is on a black field.

First, the total number of good arrangements is $n!$ because in each of the $n$ rows, we must choose a unique column for the figure.

The number of good arrangements in which one figure is on one black field is simply $(n-1)!$ because that figure is in the corner, and all others are arranged on the remaining board, which is a standard board of dimensions $(n-1) \times (n-1)$.

The number of good arrangements in which both black fields are occupied is (by the same logic as in the previous case) $(n-2)!$.

Finally, the principle of inclusion and exclusion gives us the result

$$
n! - 2 \cdot (n-1)! + (n-2)! = (n^2 - 3n + 3)(n-2)!
$$