Initial momentum of the system block (C) =mv0. After striking with A, the block C comes to rest and now both block A and B moves with velocity v when compression in spring is x0. By the law of conservation of linear momentum mv0=(m+2m)v⇒v=
v0
3
By the law of conservation of energy K.E. of block C=K.E. of system + P.E. of system