A necessary and sufficient condition for the compactness of individually rational and feasible outcomes and the existence of an equilibrium