Energy per atom in a parallel radioactivity equation I was reading an example in my textbook and the question goes like this:

In a parallel radioactive decay, find energy liberated per atom of 'A' in MeV.


The solution is proceeded like this:
$$
 \lambda _{1}/\lambda _{2}= \frac{(T_{1/2})_2}{(T_{1/2})_1}=\frac{20}{60}=\frac{1}{3}
$$
Energy per atom of A is $$= 20\times\frac{1}{4}
+40\times\frac{3}{4}=35 MeV
$$
I have understood how we have got the first step, but I'm unable to understand the second step. Why are 1/4 and 3/4 specifically being multiplied to 20 and 40, respectively? Also, where are we using the ratio we got in the first step, in the second step? It has got me all confused. In short, how is energy per atom of A calculated?
You may state that, in $60$ s, one A atom has liberated $20$ MeV by the first reaction. In the same time, three A atoms have liberated $3·40$ MeV by the $2$nd reaction. The total energy liberated in $60$ seconds, is $120 + 20 = 140 $ MeV.- As a consequence, the average energy liberated by one A atom is $140$ Mev$  /4 = 35$ MeV