A bullet of mass 30 gms is fired into a wooden block with mass 15kg by mans of a spring.The wooden block hangs from the ceiling by a wire.If the bullet and the block rise 0.50 m and the spring constant is 2000N/m. calculate the compression of the spring.

How the spring is connected to the block?