Shapovalov A.V.

On the table, there were two decks, each with 36 cards. The first deck was shuffled and placed on top of the second deck. Then, for each card from the first deck, the number of cards between it and the same card in the second deck was counted (i.e., the number of cards between the sevens of hearts, between the queens of spades, etc.). What is the sum of the 36 obtained numbers?
Let's number the cards from top to bottom in order. In the upper deck, the numbers are from 1 to 36, and in the lower deck, from 37 to 72. Let the $i$-th card of the upper deck coincide with the $k_{i}$-th card of the lower deck ($i=1,2, \ldots, 36$). Between them lies $k_{i}-i-1$ cards, so the desired sum $S=\left(k_{1}-1-1\right)+\left(k_{2}-2-1\right)+\ldots+\left(k_{36}-36-1\right)$. By rearranging the terms $k_{1}, k_{2}, \ldots$, $k_{36}$ in ascending order, we do not change the sum. Therefore, $S=(37-1-1)+(38-2-1)+\ldots+(72-36-1)=36 \cdot 35=$ 1260.

## Answer

1260.