Rice grains were placed on the cells of a chessboard. The number of grains on any two adjacent cells differed by exactly

1. At the same time, there were three grains on one of the cells of the board, and 17 grains on another. A rooster pecked all the grains from one of the main diagonals of the board, and a hen - from the other. How many grains did the rooster get and how many did the hen get?

#
Let, for example, cell $A$, which contains three grains, is $k$ cells to the left and $n$ cells below cell $B$, which contains 17 grains. Consider the shortest paths leading from cell $A$ to cell $B$. Each such path consists of $k$ steps to the neighboring cell to the right and $n$ steps to the neighboring cell upwards, made in any order, that is, in any case, such a path consists of $k+n$ steps. At each step, the number of grains changes by exactly 1, and over the entire path, the number of grains changes by $17-3=14$. However, given the size of the chessboard, the number of possible steps both upwards and to the right cannot exceed 7, meaning the shortest path cannot contain more than 14 steps. Therefore, there must be exactly 7 steps to the right and exactly 7 steps upwards, and the number of grains must increase at each step. Thus, if cell $A$ is below and to the left of cell $B$, then both lie on the main diagonal leading to the upper right ($A$ in the lower left corner, and $B$ in the upper right). In this case, the number of grains in each cell is uniquely determined (see figure).

| 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

Then, on the specified main diagonal, there are $3+5+7+9+11+13+15+17=80$ grains. On the other main diagonal, there are $8 \cdot 10=80$ grains.

Other possible cases of the placement of these cells differ from the one considered only by symmetry (axial or central).

## Answer

80 grains each.