Two blocks of masses M and 2M are connected to a light spring constant k. That has one end fixed as shown in the figure. The horizontal surface and pulley are frictionless. The blocks are released from rest when the spring is in its relaxed state.
Maximum extension in the spring is 4Mgk
Maximum kinetic energy of the system is 2M2g2k
Maximum energy stored in the spring is four times that of maximum kinetic energy of the system
Applying energy equation 12kx2=2mgx⇒x=4mgk