solution

m = 6 (slider from 1 to 12, step 1)
A: (0, 0)
B: (x(A), 16)
f = Segment(B, A)
C = (9, 0)
D: (x(C), m)
g = Segment(D, C)
M = Point(xAxis)
h = Segment(B, M)
i = Segment(M, D)
P: (x(M), Distance[B, M] + Distance[M, D])
D': (x(D), (-y(D)))
j = Segment(B, D')
I = Intersect(j, xAxis)
k = OrthogonalLine(I, xAxis)
distanceAM = Distance(A, M)
a = Distance(A, M)
b: Distance[B, M] + Distance[M, B]
c: false