Quasifree scattering of 1 GeV protons from 12C and 40Ca