$18\times| \mathop{Mg}\limits^0\to \mathop{Mg}\limits^{+2}+2e$
$1\times| 7\mathop{N}\limits^{+5}+36 e \to 2\mathop{N}\limits^{+1} + 4\mathop{N}\limits^0+ \mathop{N}\limits^{-3}$
$\Rightarrow 18Mg + 44HNO_3\to 18Mg(NO_3)_2+ N_2O+2N_2+NH_4NO_3+ 20H_2O$