Algorithm 3d inner boxes fit in 3d outer boxes