Theo đề bài ta có hpt:
\(\left\{{}\begin{matrix}p_X+e_X+n_X+p_Y+e_Y+n_Y=96\\p_X+e_X-n_X+p_Y+e_Y-n_Y=32\\p_Y+e_Y-p_X-n_X=16\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}2p_Y-2p_X=16\\4p_X+4p_Y=128\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}p_X=20\\p_Y=12\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}X:Ca\left(Canxi\right)\\Y:Mg\left(Magie\right)\end{matrix}\right.\)