How to divide surface into predefined rectangles

We would like to divide a surface into a multiple of 3 (or 4) different predefined rectangles.
This way we could use this for dividing floorplans into 3 (or 4) predefined appartementtypes, and let Galapagos figure out the best distribution.

In the preview below the 2 surfaces are split by a corridor.