CO adsorption on Pt (111) and Pd (111) surfaces: A first-principles based lattice gas Monte-Carlo study