How to generate an adaptable Building Volume where Total Floors Area stay the same

Hi there.

I just started working on GH so I need your help.

What I’m trying to do is to create a gh script on which the lenght ‘l’ and the widht ‘w’ which are both multiplied for 7.5meters (structural grid of the building) divided by the number of floors ‘f’ automatically generates a building volume which maintains a fixed Total Floor Area ‘Ta’.
The main expression would be therefore: (l x 7.5) x (w x 7.5) x f = 11250sqm ‘Ta’

where: ‘l’ and ‘w’ and ‘f’ have a minimum value of 1 and maximum value of 200.
Therefore, the minimum size of the building in lenght (value of 1) will generate a building volume of 7.5m (‘l’) x 1500m (‘w’).
you can find attached an image of a file I got stuck with. The issue is that it doesn’t automatically adapts when you change the floors f the buildings.

Hope to hear back soon from you guys. Thanks in advance


(upload:// (20.6 KB) x 1 floor.