Mechanism of excitation of two-electron--one-photon K x rays in heavy-ion collisions