  In order to find the conditions which determine whether X-Ray hot gas in
galaxy groups (intragroup gas; IGG) is heated externally or internally, we
investigate the evolution of blast waves in galaxy groups growing on a
hierarchical clustering scenario. We find that the blast waves driven by
quasars are confined in groups and heat the IGG internally at z<~ 1. However,
at z>~ 1, they expel the IGG from groups; the expelled gas may fall back into
the groups later as externally heated gas. Moreover, this may explain the
observed low metal abundance of IGG. For blast waves driven by strong
starbursts, the shift of the fate of blast waves occurs at z~ 3. On the other
hand, although blast waves driven by weak starbursts do not expel IGG from
groups, the heating efficiency decreases at z>~ 3 because of radiative cooling.
It will be useful to compare these results with XMM-Newton observations.
