The smallest number of cans is 36. 12 cans of each type A, B, and C can be stacked into a pyramid as follows:

AB BA A AB B B BC C C C CB B B B B BC C C C C C CA A A A A A A A

Reasoning why it does not work with fewer than 36 cans:

The number $k$ of cans must be a triangular number, i.e., of the form $k=1+2+\ldots+n=\frac{n(n+1)}{2}$. $k$ must have the factor 3.

Thus, for $k<36$, the numbers $3=1+2, 6=1+2+3, 15=1+2+3+4+5$, and $21=1+2+3+4+5+6$ are the only candidates.

The summands $1,2, \ldots, n$ must then be divided into three partial sums, each of which equals $\frac{k}{3}$.

For $k=3=1+2$ or $k=6=1+2+3$, such a division is not possible, as the largest summand (2 or 3) is already greater than $\frac{k}{3}$, and thus does not fit into any partial sum.

For $k=15=1+2+3+4+5$, the summands can only be divided in one way to yield the partial sum $\frac{k}{3}=5$: $1+4=2+3=5$. However, this division contradicts condition (6), as the second and third rows would then contain the same types of cans.

For $k=21=1+2+3+4+5+6$, the summands can also only be divided in one way to yield the partial sum $\frac{k}{3}=7$: $1+6=2+5=3+4$. And here, too, we get two adjacent numbers in one of the partial sums, namely 3 and 4.

With $k=36=1+2+3+4+5+6+7+8$, it finally works:

$\frac{k}{3}=12=1+3+8=2+4+6=5+7$.
## Task 3 - 120923

$\mathrm{For}$ decorative purposes, identical cans of different types are to be arranged in several rows stacked on top of each other, such that the following conditions are met:

(1) Each row must contain exactly one more can than the row immediately above it.

(2) The top row contains exactly one can.

(3) Exactly three different types of cans are used.

(4) Exactly the same number of cans of each of the three types is used.

(5) Each row consists of cans of exactly one type.

(6) No two immediately adjacent rows contain cans of the same type.

Determine the smallest number of cans for which it is possible to simultaneously meet conditions (1) to (6)!