\section*{Problem \(4-340944=340844\)}

Axel performs a card trick. He uses a Skat deck, consisting of 4 cards of each of the following types, to which he assigns the following point values:

\begin{tabular}{|c|c|c|c|c|c|c|c|c|}
\hline Type of Card & 7 & 8 & 9 & 10 & Jack & Queen & King & Ace \\
\hline Point Value & 7 & 8 & 9 & 10 & 2 & 3 & 4 & 11 \\
\hline
\end{tabular}

His friends are supposed to form card stacks according to the following rules while he is not in the room: For each stack, a card is first laid face up, and the stack thus beginning receives as many points as the point value of this card indicates.

Then more cards are laid face down on the stack; for each of these cards, the point total of the stack is increased by 1. This is done only until the point total reaches 11; the stack is then complete.

It is then turned over so that the previously bottom card now lies face down on top.

1. Example: Lay a 7 face up, lay four cards face down on top, then turn the stack over.

2. Example: Lay an Ace face up, then turn the stack over.

Such stacks are formed several times and placed side by side on the table. If there are any cards left over at the end, these "remaining cards" are placed face down and countable individually next to the stacks.

Then Axel is called in. He claims that he can find the sum of the point values of the now top cards of the stacks from the number of completed stacks and the number of remaining cards. How is this possible?
}

Before the first pile was formed, the number of remaining cards was 32. Let \(a_{1}\) be the value of the card first laid open for the first pile. Then the number of remaining cards decreases by \(1+\left(11-a_{1}\right)=12-a_{1}\), because in addition to the one card laid open with value \(a_{1}\), another \(11-a_{1}\) cards are placed on this pile.

Analogously, each subsequent pile with the first open card value \(a_{i}\) reduces the number of remaining cards by \(12-a_{i}\).

If Axel sees \(n\) piles and \(r\) remaining cards, he knows

\[
r=32-\left(12-a_{1}\right)-\cdots-\left(12-a_{n}\right)=32-n \cdot 12+\left(a_{1}+\cdots+a_{n}\right)
\]
or \(a_{1}+\cdots+a_{n}=n \cdot 12+r-32\),

thus he knows the sum of the values of the first cards laid open for each pile, which are now the top cards of each pile after being turned over.