A 2-kg block slides on a frictionless horizontal surface and is connected on one side to a spring (k = 40 N/m) as shown in the figure. The other side is connected to a 4-kg block that hangs vertically. The system starts from rest with the spring unextended.

What is the speed of the 4-kg block when the extension is 50 cm?