> 
> Given three bodies with mass $m$ each - body $1$ moves (to the right) towards the stationary body $2$ with velocity $v\_1=7v$ and collide with it. On the other side of body $2$, body $3$ moves (to the right) with velocity $v\_3 = v$, with a massless spring (with a constant $k$) attached to its left part. After the collision of bodies $1,2$, they move together towards body $3$, and contract the spring as they collide with it. What is the maximal contraction of the spring?
> 
> 
> 

To calculate this, I started by calculating the velocity of the center of mass, which is $v\_{cm}=\frac{8}{3}v$ (this is correct). Afterwards, I tried using conservation of energy, which did not result in the right answer (I do not know what the right answer is, just that the answers I submitted). My attempts are:

1. Equating the energy at the time of maximal contraction and energy in the beginning of the experiment.
$$
\frac{1}{2} (3m) \cdot v\_{cm}^2 + \frac{1}{2} k (\Delta x)^2 = \frac{1}{2} m v\_1^2 + \frac{1}{2}m v\_3^2 
$$
2. Equating the energy at the time of maximal contraction and energy after the collision of bodies $1$ and $2$ .
$$
\frac{1}{2} (3m) \cdot v\_{cm}^2 + \frac{1}{2} k (\Delta x)^2 = \frac{1}{2} (2m) \cdot \left( \frac{1}{2} v\_1 \right) ^2 
$$

What am I getting wrong here?