Elastic and inelastic scattering of 1 GeV protons by 12C