I don't understand how you would find the centre of mass of $\displaystyle CD$ from $\displaystyle AB$? Thanks in advance.
Did you set it up on coordinate axes? I put the Origin in the lower left-hand corner.
Can you find the Center of Mass? (a,b) The x-coordinate would answer the question in the problem.
For the distance from CD, you need only the equation of CD which is simple enough (y-0) = (4/3)(x-4) or 4x - 3y - 16 = 0. This leads directly to the solution $\displaystyle \frac{|4(a)-3(b)-16|}{5}$.