Explanation:
the distance of a vertex on the 2 outgoing sides to the touching points with the inscribed circle is the same for both sides.
and that applies to all 3 vertexes.
so, we know for the top left vertex the distance to both touching points is 4.
that means the distance to the touching points from the bottom left vertex is 7-4 = 3.
and that means that the distance to the touching points from the bottom right vertex is 16-3 = 13.
so, x = 13
it is the distance to one of the touching points for the bottom right vertex.
and the perimeter of the triangle is therefore
7 + 16 + (13 + 4) = 40