Explanation:
the total length of all lines is 100.
there are 2 times a d line, and 5 times an x line.
well, what we have here is an equation :
2d + 5x = 100
2d = 100 - 5x = 5×(20 - x)
d = 5/2 × (20 - x) = 50 - 5x/2
take whatever form fits best to what your teacher does in class.