Your description is quite unspecific. You do not state what the sizes of the boxes are (real numbers, are there any restrictions, ...). If you are interested in stuff like that and practice algorithm traning, go for
www.spoj.pl. It is a good Online Judge, accepting major programming languages. You will finde similar task there!