Factors of disconnected graphs and polynomials with nonnegative integer coefficients