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/k
B. 2Mg/k
C. 4Mg/k
D. Mg/2k