We study the existence of an inverse integrating factor for a class of systems, in general non-integrable, whose lowest-degree quasi-homogeneous term is a Hamiltonian system and its Hamiltonian function only has simple factors over C[x,y].