Another way to reach the same result is to work directly with the rate equations without summing all three at once.
Let $p = 1/A$, $q = 1/B$, $r = 1/C$ be the one day work rates. Then $p+q = 1/20$, $q+r = 1/30$, $p+r = 1/40$.
Subtract the second equation from the first: $(p+q) - (q+r) = p - r = \dfrac{1}{20} - \dfrac{1}{30} = \dfrac{3-2}{60} = \dfrac{1}{60}$.
Now combine this with the third equation $p + r = 1/40$: adding $p - r = 1/60$ and $p+r = 1/40$ gives $2p = \dfrac{1}{40} + \dfrac{1}{60} = \dfrac{3+2}{120} = \dfrac{5}{120} = \dfrac{1}{24}$, so $p = 1/48$.
Subtracting instead gives $2r = \dfrac{1}{40} - \dfrac{1}{60} = \dfrac{3-2}{120} = \dfrac{1}{120}$, so $r = 1/240$.
A alone takes $1/p = 48$ days and C alone takes $1/r = 240$ days, so the ratio is $48:240 = 1:5$, matching option D.
\[\boxed{1:5}\]