I know how to use both the remainder theorem and the factor theorem, but I'm not sure how to use them in relation to this problem:

When a polynomial is divided by $\displaystyle x-p$, the remainder is $\displaystyle p^3$.Any help would be greatly appreciated, even if it's just a few hints to point me in the right direction.

When a polynomial is divided by $\displaystyle x-q$, the remainder is $\displaystyle q^3$.

Find the remainder when the polynomial is divided by $\displaystyle (x-p)(x-q)$.