**Answer:**

10,583 flexible cubes

9915 rigid cubes

**Step-by-step explanation:**

The equation for the surface area of a square pyramid is area of base plus perimeter of base multiplied by the slant height

Surface area = A + 1/2·p·s

The volume of the pyramid = 1/3×A×h

Where:

A = Area of the base = 20 × 20 = 400 ft²

h = The height of the pyramid = √((slant height)² - ((base side length)/2)²)

h = √(80² - (20/2)²) = 30·√7

The volume of the pyramid = 1/3*400*30·√7 = 4000·√7 ft³ = 10,583.005 ft³

If the cubes are flexible, approximately 10,583 cubes

For rigid cubes we have

Given that the height of the pyramid = 30·√7

The slope of the pyramid = 30·√7/10 = 3·√7

So an increase in height of 1 foot gives a reduction in width of 2/(3·√7)

The bottom can hold 400 cubes

The next layer can hold 19×19 = 361

3rd 361

4th 361

5th 324

6th 324

7th 324

8th 324

9th

Continuing, we get a total of about 9915 rigid cubes in the pyramid.