According to the meaning of the question: s=(vA-vB)t…
VA=0.7m/s,vB=-0.2m/s,
From the conservation of mechanical energy: EP+12 (ma+MB) v02 =12mvaa2+12mvbb2 ③.
Solution: EP = 0.027 J.
Answer: the elastic potential energy when the spring is locked is 0.027 J.