A bullet from a gun is fired on a rectangular wooden block with velocity $u$. When bullet travels $24\ \text{cm}$ through the block along its length horizontally, velocity of bullet becomes $\dfrac{u}{3}$. Then it further penetrates into the block in the same direction before coming to rest exactly at the other end of the block. The total length of the block is:
$v^2 - u^2 = 2as$. From $u$ to $u/3$ in 24 cm: $\dfrac{8u^2}{9} = 2a(24)$. From $u/3$ to 0: $\dfrac{u^2}{9} = 2a\,s\Rightarrow s = 3$ cm. Total $= 27$ cm.