Answer
The maximum distance that the block will compress the spring is 0.346 meters.
Work Step by Step
We can find the change in momentum of the stone.
$\Delta p = m \Delta v$
$\Delta p = (3.00~kg)(10.0~m/s)$
$\Delta p = 30.0~kg~m/s$
The change in momentum of the block will be equal in magnitude. We can find the initial speed of the block after the stone hits it.
$m~v = 30.0~kg~m/s$
$v = \frac{30.0~kg~m/s}{15.0~kg}$
$v = 2.00~m/s$
The initial kinetic energy of the block will be equal to the potential energy stored in the spring.
$U_s = K$
$\frac{1}{2}kx^2 = \frac{1}{2}mv^2$
$x^2 = \frac{mv^2}{k}$
$x = v~\sqrt{\frac{m}{k}}$
$x = (2.00~m/s)~\sqrt{\frac{15.0~kg}{500.0~N/m}}$
$x = 0.346~m$
The maximum distance that the block will compress the spring is 0.346 meters.