Question

A bullet of mass m is fired at speed v0 into a wooden block of mass
M. The bullet instantaneously comes to rest in the block. The block
with the embedded bullet slides along a horizontal surface with a
coefficient of kinetic friction µ. Which one of the following
expressions determines how far the block slides before it comes to
rest (the magnitude of displacement s in the figure)? Explain your
answer.

It is a multiple choice question and I know that the answer is: s =
(m/m+M)^2 v0^2/2ug
But how do you explain that it is that answer? I don't know how