11.6. A stack consists of 300 cards: 100 white, 100 black, and 100 red. For each white card, the number of black cards lying below it is counted; for each black card, the number of red cards lying below it is counted; and for each red card, the number of white cards lying below it is counted. Find the maximum possible value of the sum of the three hundred resulting numbers.
Answer: 20000.

Solution. First method. The number of different permutations of cards is finite. Therefore, their arrangement with the largest indicated sum exists (possibly not unique).

Let the cards lie in such a way that this sum is maximal. Without loss of generality, we can assume that the top card is white. Then, in this arrangement, pairs of cards CB, BK, and WB cannot lie consecutively from top to bottom, otherwise, the sum can be increased by swapping them in such pairs (symmetric pairs do not increase the desired sum when swapped). Therefore, the cards must lie as follows (from top to bottom): WW...WBB...BBKK...KKWW...W...

The length of each subsequent series of cards of the same color cannot be less than the length of the previous series. Indeed, if, for example, in the arrangement with the largest sum, there is a fragment ...WWWBBK..., then the K card can be moved to the top: ...KWWWBB..., increasing the sum. Since the number of cards of each color is the same, the lengths of all series must be the same (otherwise, there will be more cards of the color that ends up at the bottom than cards of another color). Then the series of the same color can be rearranged "in a cycle," without changing the sum, that is, to get such an arrangement of cards: 100 white cards on top, 100 black cards below them, and 100 red cards at the bottom. Therefore, the desired sum is $100 \cdot 100 + 100 \cdot 100 = 20000$.

Second method. Let the number of cards of each of the three colors be $n$. Using the method of mathematical induction, we will prove that for the specified sum $S$, the inequality $S \leq 2 n^{2}$ holds.

Base of induction. For $n=1$, by enumeration, we verify that $S \leq 2$. Induction step: Suppose the inequality is true for $n$ cards of each color. We will prove that it is true if the number of cards of each color is $n+1$. Consider how the sum $S$ can increase if one card of each color is added. Without loss of generality, we can assume that the white card is added to the very top of the stack, and the added black and red cards are the topmost among the cards of their color. Let there be $b$ previously lying black cards above the first red card from the top, and $w$ previously lying white cards above the first black card from the top. Then the white card adds $n+1$ to the sum (considering all black cards lying below it), the black card adds $n+1$ (considering all red cards lying below it) and $w$, due to it lying below $w$ old white cards, and the red card adds no more than $n-w$ due to white cards lying below it and $b$ due to it lying below $b$ old black cards. In total, $S \leq 2 n^{2} + n + 1 + n + 1 + w + n - w + b = 2 n^{2} + 3 n + b + 2$. Considering that $b \leq n$, we get: $S \leq 2 n^{2} + 4 n + 2 = 2(n+1)^{2}$.

Thus, the statement is proved for all natural $n$. For $n=100$, we get that $S \leq 2 \cdot 100^{2} = 20000$. This value is achieved, for example, with the following arrangement: 100 white cards on top, 100 black cards below them, and 100 red cards at the bottom.

Grading criteria.

“+" A complete and well-reasoned solution is provided

“士” A generally correct solution is provided, containing minor gaps or inaccuracies

“Ғ” The correct answer is obtained based on the assumption that the lengths of all monochromatic series of cards are the same, but this is not proven

"Ғ" The solution contains correct ideas on how to maximize the sum by rearranging the cards, but the solution is not completed or contains errors

"-" Only the answer is provided or the answer is obtained by considering only specific cases

“-" An incorrect solution is provided or it is absent