Correct Answer - B
The spring will exert maximum force when A is at lowest position, say at distance x from the present position.
`therefore" "mgx=(1)/(2) kx^(2)`
where, k is force constant of the spring, for the block B to leave contact, kx = Mg
`therefore " "mgx=(1)/(2) Mgx`
`therefore" "m=(M)/(2)`