A 5.00-g bullet moving with an initial speed of 400 m/s is fired into and passes through a 1.00-kg block, as in Figure. The block, initially at rest on a frictionless horizontal surface, is connected to a spring with a spring constant of 900 N/m. If the block moves 5.00 cm to the right after impact, find (a) the speed at which the bullet emerges from the block and (b) the mechanical energy lost in the collision.