See attached image for steps. Take the figure and convert it into a rectangle and right triangle by drawing a single line. The Pythagorean Theorem can then be used.
If we draw a line parallel to the 12 cm line right below the line x, a right-angled triangle is formed, with x as the hypotenuse and the shortest side equal to (8 - 7 = ) 1 cm.