Solution (source code)

= Solution

A <meromorphic function> on a compact <Riemann surface> has finitely many poles, say $p_j$ of orders $r_j$. For each $p_j$, choose a projective line through it that does not contain $C$. Its <hyperplane divisor> contains $p_j$ with multiplicity at least one. Include $r_j$ copies of this <divisor>. The sum then dominates the pole <divisor> of $f$.

Add further arbitrary <hyperplane divisors> until their number $m$ satisfies $m\geq d$ and $md>2g-2$. Adding effective <divisors> cannot destroy the pole bound, so for $D=H_1+\cdots+H_m$ we have
$$
(f)+D\geq0,\qquad\boxed{f\in L(D).}
$$
For a constant function, including zero, no initial poles need to be covered; simply add sufficiently many lines.