Factorise polynomials by common factor (#302)

Factorise polynomials by common factor (#302)

Extract the greatest common factor from all terms.