Dividing polynomials with remainders