5. Two monic polynomials (i.e., with the leading coefficient equal to 1) with integer coefficients $p(x)$ and $q(x)$ are such that their greatest common divisor is $(x-1)(x-2)$, their least common multiple is $(x-1)^{2}(x-2)^{3}(x-3)(x+1)$, and the degree of $p(x)$ is less than or equal to the degree of $q(x)$. In how many ways can $p(x)$ be chosen?
(A) 4
(B) 5
(C) 8
(D) 10
(E) 12
5. The answer is $\mathbf{( C )}$. Consider the four factors of the least common multiple $A(x)=(x-1)^{2}$, $B(x)=(x-2)^{3}$, $C(x)=x-3$ and $D(x)=x+1$. For the least common multiple of $p(x)$ and $q(x)$ to be $A(x) B(x) C(x) D(x)$, it is necessary that each of the four factors divides at least one of the two polynomials; on the other hand, each factor divides exactly one of the two polynomials, or it would divide the greatest common divisor of the two (which we know is $(x-1)(x-2)$). Ignoring for a moment the condition on the degree of the two polynomials. Once we have decided which of the four factors appear in $p(x)$, it is determined: it is the least common multiple of the product of the chosen factors and $(x-1)(x-2)$; similarly, $q(x)$ is also determined: it is the least common multiple of the factors not chosen and $(x-1)(x-2)$. Note that $p(x)$ and $q(x)$ cannot have the same degree, since their product is $A(x) B(x) C(x) D(x)(x-1)(x-2)$, which has degree 9, hence odd. In conclusion, we know that the number of ordered pairs of polynomials $(p(x), q(x))$ with given greatest common divisor and least common multiple is $2^{4}=16$ (the number of subsets of the set of the four factors $A(x), B(x), C(x), D(x))$. On the other hand, swapping the two polynomials in the pair reverses the inequality (which we know is strict) between the degrees: exactly one pair out of every two is such that the degree of $p(x)$ is greater than that of $q(x)$. The correct answer is therefore 8.