You subtract the volume of the pyramid from the volume of the prism. The volume of the prism is 5*5*12, which is 300cm^3. The volume of the pyramid is (5*5*6)/3, which is 50cm^3. 300-50=250, so the volume of the space outside the pyramid but inside the prism is 250cm^3.