Nuclear Resonant Inelastic and Forward Scattering of Synchrotron Radiation by 40K