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 unstretched. Then the maximum extension in the spring is
A. Mg/2k
B. Mg/k
C. 2 Mg/k
D. 4 Mg/k