A magician has a hundred cards, numbered from 1 to 100. He places each of them into one of three boxes - a red box, a white box, and a blue box - in such a way that each box contains at least one card.

A member of the audience selects two of the three boxes and draws one card from each, then announces the sum of the numbers on the drawn cards. Knowing this sum, the magician can tell which is the box from which no card was drawn.

In how many ways can the cards be placed in the boxes so that this trick always works? (Two arrangements are considered different if there is at least one card that ends up in a different box.)
Let the three boxes be $A, B$, and $C$.

$$
A=\left\{a_{1}<a_{2}<\cdots<a_{k}\right\}, B=\left\{b_{1}<b_{2}<\cdots<b_{l}\right\}, C=\left\{c_{1}<c_{2}<\cdots<c_{m}\right\}, \quad(k+l+m=100)
$$

Consider the following sums:

$\left\{a_{1}+b_{1}<a_{1}+b_{2}<\cdots<a_{1}+b_{l}<a_{2}+b_{l}<\cdots<a_{k}+b_{l}\right\}\left\{a_{1}+c_{1}<a_{1}+c_{2}<\cdots<a_{1}+c_{m}<a_{2}+c_{m}<\cdots<a_{k}+c_{m}\right\}\left\{b_{1}+\right.$

(The inequalities follow from the original inequalities)

Since two groups cannot have the same sum, we have $k+l-1+k+m-1+l+m-1=2(k+l+m)-3=$ 197 different numbers. From the numbers 1 to 100, exactly 197 different two-term sums can be formed $(1+2=3$, $\ldots 99+100=199)$, so all numbers are included. We then examine the possibilities through case analysis:

Let's start filling the boxes. Notice that since the sum 3 is formed, the cards 1 and 2 must go into different boxes. These two cards can be arranged in six different ways. Suppose the card 1 goes into box $A$, and the card 2 goes into box $B$. The card 3 cannot then go into box $A$, otherwise the sum 4 cannot be formed. Therefore, the card 3 either goes into box $B$ - where the card 2 is - or into the previously empty box $C$. We claim that the placement of the remaining cards is unique in both cases.

1. Case (the card 3 goes into box $B$):

- Box $C$ is not empty, so let the smallest card in $C$ be $k$. Then $k+1$ can only go into $A$, otherwise $2+k=(k+1)+1$, and the magician cannot decide.

But then $(k+1)+2=k+3$, and the magician still cannot decide unless there is no card $k+1$. Thus, $k+1$ "does not exist", so $k=100$. In this case, there is one card in boxes $A$ and $C$, the 1 and the 100, respectively, and the rest go into box $B$. This arrangement is clearly valid, so we have six cases.

2. Case (the card 3 goes into box $C$):

$\bullet 2+3=4+1,4 \in A$

$5+1=4+2$ so $5 \notin C$, and $5+2=4+3$, so $5 \notin A$. Thus, $5 \in B$. Similarly,

$6+1=4+3$, so $6 \notin B$, and $6+2=5+3$, so $6 \notin A$. Thus, only $6 \in C$ is possible.

By playing this with the second row, we find that the numbers are arranged according to their remainder when divided by 3, and this arrangement is indeed valid. This gives us another six cases.

Thus, there are 12 arrangements in total where the trick can always succeed.

Máté Vizer (Fazekas M. Főv. Gyak. Gimn., 12th grade)