I doubt it will be possible to solve this problem UNLESS you draw a figure.
Let the hypotenuse be divided into 2 parts by the line joining the center to the tangent; call them a and b.
The legs will then be r+a and r+b because there are 2 sets of congruent triangles and a square in the right angle corner of the right triangle.
Therefore we have (a+r) + (b+r) = m and c + 2 r = m => 2r = d = m-c