19. There are 10 red, 10 black, and 10 white balls. Now, all of them are to be placed into two bags, A and B, with the requirement that each bag must contain balls of all three colors, and the product of the number of balls of each color in bags A and B must be equal. How many ways are there to do this?
19. Let the number of red, black, and white balls in bag A be $x$, $y$, and $z$ respectively. Then $1 \leqslant x, y, z \leqslant 9$, and
$$
x y z=(10-x)(10-y)(10-z) \text {, }
$$

i.e., $x y z=500-50(x+y+z)+5(x y+y z+z x)$.
Thus, $5 \mid x y z$.
Therefore, one of $x, y, z$ must be 5.
Assume $x=5$, substituting into equation (1) gives $y+z=10$.
At this point, $y$ can take $1,2, \cdots, 9$ (correspondingly $z$ takes 9, 8, ..., 1), for a total of 9 ways.

Similarly, when $y=5$ or $z=5$, there are also 9 ways each.

However, when $x=y=z$, two ways are repeated, so there are a total of $9 \times 3-2=25$ ways.