Ground-state energy of many-electron systems from x-ray-scattering cross sections