Answer
$d=\frac{(m_A+m_B)g}{k}$
Work Step by Step
We can determine the required distance as follows:
$\Sigma F_y=ma_y$
We know that
$y_{eq}=\frac{F_s}{k}=\frac{(m_A+m_B)g}{k}$
For block $A$ and the pan
$\Sigma F_y=ma_y$
$\implies k(y_{eq}+d)-(m_A+m_B)g=(m_A+m_B)a$
$\implies k[(\frac{m_A+m_B}{k})g+d]-(m_A+m_B)g=(m_A+m_B)(\frac{N-m_Ag}{m_A})$
This simplifies to:
$d=\frac{(m_A+m_B)g}{k}$