Two ring of mass m and 2 m are connected with a light sppring and can slide over two frictionless parallel horizontal rails as shown in figure. Ring of mass m is given velocity v0 in horizontal direction as shown. Calculate the maximum stretch in spring during subsequent motion.

