The base of a straight pyramid is a square. The height of the pyramid is $4 \mathrm{~cm}$ less than the side of the base. If we decrease the height by $2 \mathrm{~cm}$ and increase the side of the base by $2 \mathrm{~cm}$, then the volume of the pyramid will be $18 \mathrm{~cm}^{3}$ larger. What is the volume of the original pyramid?
If the base edge of the pyramid is $x$, then according to the problem

$$
\frac{x^{2}(x-4)}{3}+18=\frac{(x+2)^{2}(x-6)}{3}
$$

or

$$
x^{2}-10 x-39=0
$$

from which the positive value of $x$ is 13. Therefore, the volume of the pyramid

$$
K=\frac{x^{2}(x-4)}{3}=507 \mathrm{~cm}^{3}
$$