$\text{Using the relation},\text{ M}_2=\frac{1000\times\text{k}_\text{f}\times\text{w}_2}{\text{w}_1\times\Delta\text{T}_\text{f}}$ $\therefore\ \text{M}_{\text{AB}_2}=\frac{1000\times5.1\times1}{20\times2.3}=110.87\text{ g mol}^{-1}$
$\text{M}_{\text{AB}_4}=\frac{1000\times5.1\times1}{20\times1.3}=196.15\text{ g mol}^{-1}$
Let the atomic masses of A and B are 'p' and 'q' respectively.
Then molar mass of
AB2 = p + 2q = 110.87 g mol-1 .... (i)
And molar mass of
AB4 = p + 4q = 196.15 g mol-1 .... (ii)
Substracting equation (ii) from equation(i), we
get 2q = 85.28 ⇒ q = 42.64
Putting q = 42.64 in equ. (i), we get
p = 110.87 - 85.28
p = 25.59
Thus, atomic mass of A = 25.59 g mol-1 and atomic mass of B = 42.64 g mol-1