Solution (source code)

= Solution

For a nonzero <polynomial> $f=\sum_i a_it^i\in\mathbb Z[t]$, its <polynomial content> is the positive <greatest common divisor> of its coefficients:
$$
c(f)=\gcd(a_0,a_1,\ldots)>0.
$$
For nonzero $g\in\mathbb Q[t]$, choose a positive <integer> $n$ with $ng\in\mathbb Z[t]$ and define its <rational polynomial content> by
$$
\boxed{c(g)=\frac{c(ng)}n.}
$$
To check independence of the denominator, write $g=f/n=h/m$ with $f,h\in\mathbb Z[t]$ and $n,m>0$. Then $mf=nh$, while multiplication of all coefficients by a positive <integer> gives
$$
mc(f)=c(mf)=c(nh)=nc(h).
$$
Dividing by $mn$ proves $c(f)/n=c(h)/m$, as required.

For multiplication, write $g_i=f_i/n_i$. The integer-coefficient content identity permitted in the source gives
$$
\begin{aligned}
c(g_1g_2)
&=\frac{c(f_1f_2)}{n_1n_2}
=\frac{c(f_1)c(f_2)}{n_1n_2}\\
&=c(g_1)c(g_2).
\end{aligned}
$$
Thus
$$
\boxed{c(g_1g_2)=c(g_1)c(g_2).}
$$
We will also use the normalization $g/c(g)\in\mathbb Z[t]$, with content one: if $g=f/n$, then $g/c(g)=f/c(f)$. It is a <primitive polynomial>. For a nonzero rational constant $r$, the same definition gives $c(r)=|r|$.