Time-interleaved multienergy acceleration for an x-ray free-electron laser facility