Let A’s home is $$2x \,km$$ from school and B’s home is $$x \,km $$
Hence,
A’s home distance from school: B’s home distance from school $$ = 2: 1 $$
(A’s home distance from school) / (B’s home distance from school) $$ = \dfrac{2}{1} $$
A’s home distance from school $$ = 2 \times $$ B’s home distance from school
(a) So if A lives at a distance of $$4 \,km $$ then B will live at a distance of $$ = \dfrac{1}{2} \times 4 $$
$$ = 2\, km $$
(b) So if B lives at a distance of $$9\,km$$ then A will live at a distance of $$ = 2 \times 9$$
$$ = 18\, km $$
(c) So if A lives at a distance of $$8\,km$$ then B will live at a distance of $$ = \dfrac{1}{2} \times 8 $$
$$ = 4\, km $$
(d) So if B lives at a distance of $$ 8 \,km$$ then A will live at a distance of $$ = 2 \times 8$$
$$ = 16\, km $$
(e) So if A lives at a distance of $$ 6\, km$$ then B will live at a distance of $$ = \dfrac{1}{2} \times 6 $$
$$ = 3 \,km $$