Point M is the centroid of the triangle, which divides each median in a 2:1 ratio, with the longer segment closer to the vertex.
Using the centroid property:
\[ AM = \frac{2}{3} \times AD = \frac{2}{3} \times 21 = 14 \text{ cm} \]
Using the centroid property:
\[ MD = \frac{1}{3} \times AD = \frac{1}{3} \times 21 = 7 \text{ cm} \]
Since \( BD + CD = BC \) and \( BD = BC - CD \), we have:
\[ BD = 24 - 7 = 17 \text{ cm} \]
The total length is:
\[ BD + MD = 17 + 7 = 19 \text{ cm} \]
The sum of the lengths of BD and MD is 19 cm.