A triathlete competes in a triathlon in which the swimming, biking, and running segments are all of the same length. The triathlete swims at a rate of 3 kilometers per hour, bikes at a rate of 20 kilometers per hour, and runs at a rate of 10 kilometers per hour. Which of the following is closest to the triathlete's average speed, in kilometers per hour, for the entire race?
$\mathrm{(A)}\ 3\qquad\mathrm{(B)}\ 4\qquad\mathrm{(C)}\ 5\qquad\mathrm{(D)}\ 6\qquad\mathrm{(E)}\ 7$
Let $d$ be the length of one segment of the race.
Average speed is total distance divided by total time. The total distance is $3d$, and the total time is $\frac{d}{3}+\frac{d}{20}+\frac{d}{10}=\frac{29d}{60}$.
Thus, the average speed is $3d\div\left(\frac{29d}{60}\right)=\frac{180}{29}$. This is closest to $6$, so the answer is $\mathrm{(D)}$.