Find the smallest integer $n$ such that the "expanded" writing of $(x y-7 x-3 y+21)^{n}$ contains 2012 terms.
According to the factorization of the rectangle, $x y-7 x-3 y+21=(x-3)(y-7)$, therefore $(x y-7 x-3 y+21)^{n}=$ $(x-3)^{n}(y-7)^{n}$. According to the binomial formula, $(x-3)^{n}$ and $(y-7)^{n}$ each have $n+1$ terms, and each term of the product is exactly the product of one of the terms from each of their expansions. Therefore, there are $(n+1)^{2}$ terms in the desired expansion. The inequality $(n+1)^{2} \geq 2012$ is equivalent to $(n+1)^{2} \geq 2025=45^{2}$, which is to say $n \geq 44$.