Suppose that the block of mass m is depressed by x1 and left so that the entire system just rebounds & loses contact with the ground.
Initially, there is a compression xo in the spring so that, kxo = mg
If the block B just loses contact, then the normal reaction becomes 0.