(d) -1/4kx2.
Explanation:-
The work done by the spring on both of the masses is equal to the potential energy stored in the spring. The potential energy stored in the spring = -½kx².
Since the masses are pulled out symmetrically, the work done by the string on each mass
=½(-½kx²) =-¼kx².
The negative sign is for the fact that displacement is opposite to the force.