6. (10 points) As shown in the figure, cut out an isosceles right triangle from each corner of a square cardboard, leaving a rectangle. The side length of the square and the length of the legs of the triangles are all integers. If the total area of the cut-out parts is 40 square centimeters, then the area of the rectangle is $\qquad$ square centimeters.
【Analysis】Since the two large isosceles right triangles can form a square, and the two small isosceles right triangles can form a small square, let the legs of the large isosceles triangle be $a$, and the legs of the small isosceles triangle be $b$. According to the problem, we know that $a^{2}+b^{2}=40$. Since the side lengths of the squares and the legs of the triangles are all integers, we can determine from $2^{2}+6^{2}=40$ that the legs of the large isosceles triangle and the small isosceles triangle are what, and then we can find the side length of the original square. By subtracting 40 from the area of the original square, we can find the area of the rectangle. According to this, solve the problem.

【Solution】Let the legs of the large isosceles triangle be $a$, and the legs of the small isosceles triangle be $b$
$$
\begin{array}{l}
a^{2}+b^{2}=40 \\
2^{2}+6^{2}=40
\end{array}
$$

We know that the legs of the large isosceles right triangle are 6 cm, and the legs of the small isosceles right triangle are 2 cm. The area of the original square:
$$
\begin{aligned}
& (6+2) \times(6+2) \\
= & 8 \times 8
\end{aligned}
$$
$=64$ (square cm)
$64-40=24$ (square cm)
Answer: The area of the rectangle is 24 square cm.
Therefore, the answer is: 24.