How can i calculate with a script automatic the planes positions to make small building ?

I created 5 walls using a cube.
And i can play now a very long time with the walls positions to make it to be in the right place. The ceiling the floor the walls. I was wondering if there is some way and how to calculate it to put them automatic in the right positions ?

Without using a script you can use the scene view. When the move tool is active hold V and pick a vertex and drag it onto another vertex you want to align your selection with.
This feature is called “Vertex snapping”
If you however want to use a script then Renderer.bounds could be useful for alignment.