Two-body nonleptonic decays of the heavy mesons in the factorization approach