Louis,
Read the case study at the bottom of this page,
http://www.export911.com/e911/ship/conShip.htm
and particularly follow the links for general purpose container and package orientation. I think it will give you all the facts to determine this. Note that caution that containers of the same "nominal" size (40') may have slightly different internal dimensions.
Once you have internal dimensions, you can figure out how many rows, columns, layers are possible for each box orientation. At least get the best number for the whole container packed in one orientation. The use some trial&error to see if mixed packing gives better results. Usually height and width should be the first focus for "good fit." Losing some of that dimension is a bigger hit on packing efficiency, percentagewise.