3. (20 points) In math class, each dwarf needs to find a three-digit number without zero digits, divisible by 3, such that when 297 is added to it, the result is a number with the same digits but in reverse order. What is the minimum number of dwarfs that should be in the class so that among the numbers they find, there are always at least two identical ones?
Answer: 19.

Solution: Let the number of numbers that satisfy the condition of the problem be $N$. Then, by the Pigeonhole Principle, the minimum number of gnomes must be $N+1$.

Let's write a three-digit number as $\overline{x y z}$, where $x$ is the number of hundreds, $y$ is the number of tens, and $z$ is the number of units. Since along with the number $\overline{x y z}$, the number $\overline{z y x}$ is also considered, then $x>0$ and $z>0$. According to the condition, $100 x+10 y+z+297=100 z+10 y+x$. Let's transform this:

$$
99 z-99 x=297 \Leftrightarrow x=z-3
$$

Since $0<x=z-3 \leq 9$ and $z \leq 9$, then $0<x \leq 6$. Thus, we have 6 suitable values for $x$. Each $x$ corresponds to one value of $z$, and $y$ is any number from 1 to 9 for which $\overline{x y z}$ is divisible by 3. Note that

$$
0=(x+y+z) \quad \bmod 3=(2 x+y) \quad \bmod 3
$$

which means any pair $(x, z)$ uniquely determines $y \bmod 3$. Among the numbers from 1 to 9, there are exactly 3 numbers with a given remainder when divided by 3. Therefore, the condition of the problem is satisfied by $6 \cdot 3=18$ numbers, and the minimum number of gnomes is 19.