Task 3. Lёnya has cards with digits from 1 to 7. How many ways are there to glue them into two three-digit numbers (one card will not be used) so that each of them is divisible by 9?
Answer: 36.

Solution. The sum of the digits in each number is divisible by 9, which means the overall sum of the used digits is also divisible by 9. The sum of all given digits $1+2+\ldots+7$ is 28. If we remove the digit 1, the remaining sum is 27, which is divisible by 9; removing any other digit cannot result in a sum divisible by 9. Therefore, the digits used are $2,3,4,5,6,7$.

Notice that the smallest possible sum of three of these digits is $2+3+4=9$, and the largest is $5+6+7=18$. No other sums divisible by 9 can be obtained; 9 and 18 can only be obtained in one way. Thus, one number consists of the digits $2,3,4$, and the other consists of $5,6,7$.

There are six numbers that can be formed from the digits 2,3,4, and six numbers that can be formed from the digits $5,6,7$. We need all possible pairs of these numbers.

## Criteria

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

2 p. It is proven that the digit 1 is not used.

3 p. Assuming (possibly unjustified) that the digit 1 is not used, it is proven that one number consists of the digits $2,3,4$, and the other of $5,6,7$.

1 6. The above is not proven but stated.

2 p. The correct answer is provided.