def gf_sub_ground(f, a, p, K):
    """Returns `f - a` where `f` in `GF(p)[x]` and `a` in `GF(p)`. """
    if not f:
        a = -a % p
    else:
        a = (f[-1] - a) % p

        if len(f) > 1:
            return f[:-1] + [a]

    if not a:
        return []
    else:
        return [a]