(b) Upthrust = weight of body
For $A,\frac{V_{A}}{2} \times \rho_{W} \times g = V_{A} \times \rho_{A} \times g \Rightarrow \rho_{A} = \frac{\rho_{W}}{2}$
For $B,\frac{3}{4}V_{B} \times \rho_{W} \times g = V_{B} \times \rho_{B} \times g \Rightarrow \rho_{B} = \frac{3}{4}\rho_{W}$
(Since 1/4 of volume of $B$ is above the water surface)
$\therefore\frac{\rho_{A}}{\rho_{B}} = \frac{\rho_{W}/2}{3/4\ \rho_{W}} = \frac{2}{3}$