# The system as shown is released from rest. Neglecting friction and masses of pulleys, spring & rope the spring gets elongated if

For the mass M
Net force on the system $Mg-mg+mg$
$=Mg$
Total mass being pulled $=M+2m$
Therefore $a=\large\frac{Mg}{M+2m}$
We have $a < g$
There should be an upward force on M. so that its acceleration becomes less than g. Hence for any value of M spring is elongated