An ideal spring with spring constant $k$ is hung from the ceiling and a block of mass $m$ is attached to its lower end. The mass is released with the spring initially unstreched. The maximum extension in the spring is
(a) $\frac{4 m g}{k}$
(b) $\frac{2 m g}{k}$
(c) $\frac{m g}{k}$
(d) $\frac{m g}{2 k}$