Problem 5. In the cells of an $8 \times 8$ chessboard, there are 8 white and 8 black chips such that no two chips are in the same cell. Additionally, no column or row contains chips of the same color. For each white chip, the distance to the black chip in the same column is calculated. What is the maximum value that the sum of these distances can take? The distance between chips is the distance between the centers of the cells they occupy.
Answer: 32

Solution. An example of chip placement where the sum of distances is 32 is shown in the figure:

![](https://cdn.mathpix.com/cropped/2024_05_06_856de67b2aabfad709d8g-4.jpg?height=361&width=359&top_left_y=970&top_left_x=547)

We will prove that the sum of distances cannot be greater than 32. For this, consider an arbitrary placement of chips that satisfies the condition. Let \( S \) be the sum of the distances specified in the condition.

Let the white and black chips in the \( i \)-th column be in rows \( a_i \) and \( b_i \), respectively. We estimate the distance between them:

\[
|a_i - b_i| = |(a_i - 4.5) - (b_i - 4.5)| \leq |a_i - 4.5| + |b_i - 4.5|
\]

(essentially, this is the triangle inequality for points \( a_i, b_i \), and 4.5 on a line). Summing this estimate for all differences \( |a_i - b_i| \), we get:

\[
S \leq |a_1 - 4.5| + |a_2 - 4.5| + \ldots + |a_8 - 4.5| + |b_1 - 4.5| + |b_2 - 4.5| + \ldots + |b_8 - 4.5|
\]

Notice that the right-hand side does not depend on the placement of the chips, as the numbers \( a_i, 0 \leq i \leq 8 \), are some permutation of the numbers from 1 to 8. Similarly for \( b_i \). We have:

\[
\begin{aligned}
S & \leq |1 - 4.5| + |2 - 4.5| + \ldots + |8 - 4.5| + |1 - 4.5| + |2 - 4.5| + \ldots + |8 - 4.5| = \\
& = 2 \cdot (3.5 + 2.5 + 1.5 + 0.5 + 0.5 + 1.5 + 2.5 + 3.5) = 32
\end{aligned}
\]

Remark. From the proof of the estimate, it is not difficult to understand how any example with the required sum of distances is constructed: in each column, a chip of one color is in the upper half, and a chip of the other color is in the lower half. In any other case, equality in the triangle inequality will not be achieved.

## Criteria

A complete solution to the problem is worth 7 points. In the absence of such a solution, the following criteria are summed:

6 points. It is proven that the sum of distances cannot exceed 32.

If the solution is unjustifiably reduced to some "optimal" case or class of cases (for example, it is claimed without proof that in each column, the black and white chips must be in different halves of the column), then points for this part are not given.

1 point. An example of chip placement is provided where the sum of distances is 32.