Generalized comaximal factorization of ideals