We will investigate composite bodies of various types.
We have a rectangular prism with the following dimensions:

We are to fill an empty rectangular prism with ( n ) number of small cubes with dimension as follows:

We will determine the volume occupied by ( n ) number of cubes. The general formula for the volume of a cube is as follows:

Then for ( n ) number of cubes the volume occupied is:

The volume of an empty rectangular prism is defined as follows:

Using the given dimensions we can compute the volume of the prism as follows:

The ( n ) number of small cubes must occupy the entire volume of the rectangular prism. So we will go ahead and equate the volumes of each as follows:

Plug in the respective expressions and solve for the variable ( n ) as follows:

Therefore, we can pack 30 cubes into the rectangular prism!