Pulley and spring problem

Question

Hints

Answer