def _gf_div(f, g, p):
    """
    Compute `\\frac f g` modulo `p` for two univariate polynomials over
    `\\mathbb Z_p`.

    """
    ring = f.ring
    dom = ring.domain
    domp = dom.finite_field(p)
    f, g = map(lambda x: x.set_domain(domp), (f, g))
    return tuple(map(lambda x: x.set_domain(dom), divmod(f, g)))
