From the table

| 1 | 2 | 3 | $\ldots$ | $a$ |
| :---: | :---: | :---: | :---: | :---: |
| $a+1$ | $a+2$ | $a+3$ | $\ldots$ | $2 a$ |
| $2 a+1$ | $2 a+2$ | $2 a+3$ | $\ldots$ | $3 a$ |
| $\ldots$ | $\ldots$ | $\ldots$ | $\ldots$ | $\ldots$ |
| $(a-1) a+1$ | $(a-1) a+2$ | $(a-1) a+3$ | $\ldots$ | $a^{2}$ |

$a$ numbers are selected such that no two of the selected numbers are in the same row or column of the table. Calculate the sum of the selected numbers.
Let's represent our table as the sum of two tables:

| 0 | 0 | 0 | $\ldots$ | 0 |
| :---: | :---: | :---: | :---: | :---: |
| $a$ | $a$ | $a$ | $\ldots$ | $a$ |
| $2 a$ | $2 a$ | $2 a$ | $\ldots$ | $2 a$ |
| $\ldots$ | $\ldots$ | $\ldots$ | $\ldots$ | $\ldots$ |
| $(a-1) a$ | $(a-1) a$ | $(a-1) a$ | $\ldots$ | $(a-1) a$ |$+$| 1 | 2 | 3 | $\ldots$ | $a$ |
| :---: | :---: | :---: | :---: | :---: |
| 1 | 2 | 3 | $\ldots$ | $a$ |
| 1 | 2 | 3 | $\ldots$ | $a$ |
| 1 | $\ldots$ | $\ldots$ | $\ldots$ | $\ldots$ |
| 1 | 2 | 3 | $\ldots$ | $a$ |

The selected numbers will also "split" into the sums of the corresponding numbers in these two tables. In the first table, the sum of the corresponding numbers is $0+a+2 a+\ldots+(a-1) a=1 / 2 a^{2}(a-1)$ (since the numbers are located one in each row), and in the second table, it is $-1+2+\ldots+a=1 / 2 a(a+1)$ (since the numbers are located one in each column). The total sum is $1 / 2 a^{2}(a-1)+1 / 2 a(a+1)=1 / 2 a\left(a^{2}+1\right)$.

## Answer

$1 / 2 a\left(a^{2}+1\right)$.