18.1. $[10.2$ (15 points)] A wooden parallelepiped, all sides of which are expressed in whole centimeters, was painted red, and then sawn parallel to the faces into cubes with a side of 1 cm. It turned out that one third of the resulting cubes have at least one red face, while the remaining two thirds have all faces unpainted. Find the length of the parallelepiped if it is 2 cm longer than the width and 4 cm longer than the height.
Answer: 18 cm.

Solution. Let the length of the parallelepiped be $n$ cm, then the width is $n-2$, and the height is $n-4$. This gives $n(n-2)(n-4)$ cubes. The number of uncolored cubes will be $(n-2)(n-4)(n-6)$ (a layer one cube wide is "removed" from each side). This results in the equation $(n-2)(n-4)(n-7)=\frac{2}{3} n(n-2)(n-4)$ with the condition $n \geq 7$. The roots of the equation are: $n=2, n=4, n=18$. The first two roots are not valid. Therefore, $n=18$, and this is the parallelepiped $18 \times 16 \times 14$.