The total height of the cubes stacked on top of each other is 2f + 3g2.

The cubes have a combined volume that is the same as a rectangular prism of the same height. What is the area of the base of the rectangular prism? (Recall: V = Bh)

A: 2f + 3g^2
B: 8f^3 + 27g
C: 2f - 6fg^2 + 3g^2
D: 4f^2 - 6fg + 9g^4