Generate rectangular shapes which stay within predefined grid

I want to generate rectangular shapes where sides have minimum size of 9 and max size of 60. There center could be anywhere within the box but they should not cross the boundary of box. Any suggestion or plugin for how to solve this?

can the rectangular shapes overlap each other?

Sorry maybe i was not clear enough. Each box is suppose to have only 1 rectangle within it.