## Task B-2.5.

In how many ways can three numbers be selected from the set $\{1,2,3, \ldots, 12\}$ such that their sum is divisible by 3?
## Solution.

Let these numbers be $x, y, z$. Their sum is divisible by 3 if all three numbers give the same remainder when divided by 3, or if all three numbers give different remainders when divided by 3.

In the given set, there are four numbers that give a remainder of 0, four numbers that give a remainder of 1, and four numbers that give a remainder of 2 when divided by 3.

From the four numbers that give a remainder of 0, we can choose three in 4 ways (we can choose one number that we do not want in 4 ways). Similarly for the other remainders.

This means that 3 numbers, which give the same (but not predetermined) remainder when divided by 3, can be chosen in $3 \cdot 4=12$ ways.

Three numbers that give different remainders when divided by 3 can be chosen in a total of $4 \cdot 4 \cdot 4=64$ ways.

The total number of desired selections is $64+12=76$.

Note: If a student obtained the correct result by listing, they should receive full marks.

If a student listed all combinations of numbers that are divisible by three $(\{3,6,9\},\{3,6,12\},\{3,9,12\}$, $\{6,9,12\})$, they receive 1 point.

Similarly, for all combinations of numbers that give a remainder of $1(\{1,4,7\},\{1,4,10\},\{1,7,10\}$, $\{4,7,10\})$ and for all combinations of numbers that give a remainder of $2(\{2,5,8\},\{2,5,11\},\{2,8,11\}$, $\{5,8,11\})$, the student receives 1 point for each.

If a student listed all 64 combinations of numbers that give different remainders when divided by 3, they receive 3 points.

In the case of systematic and organized listing, if one or two combinations are missing, 1 point is deducted, otherwise, points are awarded as previously described.

In the case of non-systematic listing of combinations, 1 point is deducted for each missing combination.