Solve a one-dimensional perfectly elastic collision for the final velocities of both masses, where both momentum and kinetic energy are conserved.