3. There are seven red cubes, three blue ones, and nine green ones. Ten cubes were placed in a gift bag. In how many different ways could this have been done?
Answer: 31.

Let's put red cubes into the bag (8 ways from 0 to 7), now we place the blue cubes (4 ways from 0 to 3). Add the necessary number of green cubes (1 way). In total, $8 \times 4=32$.

One operation is impossible: 10 green. Therefore, there is one fewer way.