Solution (source code)

= Solution

The <genus-degree formula> for a nonsingular plane <curve> gives
$$
\boxed{g=\frac{(d-1)(d-2)}2.}
$$
A <divisor> is a finite formal sum $D=\sum_pn_p[p]$ with integer coefficients; its degree is $\deg D=\sum_pn_p$. An effective <divisor> has all $n_p\geq0$. A <hyperplane divisor> is the intersection with a projective line not containing the <curve>, counted with local intersection multiplicities. Its degree is $d$.

Define $L(D)=\{0\}\cup\{f\text{ meromorphic}:(f)+D\geq0\}$ and $\ell(D)=\dim_{\mathbb C}L(D)$. For a <canonical divisor> $K$, the <Riemann-Roch theorem> states
$$
\boxed{\ell(D)-\ell(K-D)=\deg D+1-g.}
$$
Here $(f)$ records zero orders positively and pole orders negatively, and $\deg K=2g-2$.