$\begin{cases} n_{Fe}=x mol \\n_{Mg}=y mol \end{cases}\Rightarrow n_{HCl}=2(x+y)$$\Rightarrow m_Y=\frac{36,5.2(x+y).100}{20}+56x+24y-2(x+y)=409x+377y$
$*)\%m_{FeCl_2}=\frac{127x.100}{409x+377y}=15,76\Rightarrow x=...y$
$\Rightarrow \%m_{MgCl_2}=\frac{95y.100}{409x+377y}=....$