Volume of rectangular prism with cubes