Elastic and inelastic scattering of 16O and 12C from A = 40−96 nuclei