Set $\;g(x)=x^3-10x^2+31x$. As the remainder upon division by $x-\alpha$ is $g(\alpha)$, it is enough to determine whether
$$g(5)=g(3)=g(2)= -30,\;32,\; 30\text{ or }-28, \;\text{ respectively}.$$
We'll check this with Horner's scheme:
$$\begin{array}{*{5}{r}}
&1&-10&3&0\\
\hline
&&5&-25&30\\
\hline
\times5&1&-5&6&\color{red}{30}\\
\hline\\\hline
&&3&-21&30\\
\hline
\times3&1&-7&10&\color{red}{30}\\
\hline\\\hline
&&2&-16&30\\
\hline
\times2&1&-8&15&\color{red}{30}\\
\hline
\end{array}$$
Thus $f(x)$ would be polynomial c). Naturally, if we're confident such a polynomial exists in the list, one check will do.