Answer
$2$
Work Step by Step
If an object of mass m floats in a liquid, the downward pull of gravity has to be balanced by the upward buoyant force
Thus,
$mg=\rho_{liquid}gV_{sub} $
In the first liquid, which is water, it floats fully submerged: $V_{sub}=V_{block}$
Therefore,
$mg=\rho_{w}gV_{block}................(1)$
In liquid A, the block floats with height $h/2$ above the liquid surface.
Therefore, the height of the block which is submerged is $(h-h/2)=h/2$
Now,
$mg=\rho_{A}gV_{sub}$
Using eq. $(1)$, we obtain
or, $\rho_{w}gV_{block}=\rho_{A}gV_{sub}$
or, $\frac{\rho_{A}}{\rho_{w}}=\frac{V_{block}}{V_{sub}}$
or, $\frac{\rho_{A}}{\rho_{w}}=\frac{hA}{\frac{h}{2}A}$
or, $\frac{\rho_{A}}{\rho_{w}}=2$
Therefore, the relative density of a is $2$.