TeX source:
Solution for (b) The distance