From: mathew Date: 2005-06-30T06:00:42+09:00 Subject: Re: Programmers Contest: Fit pictures on a page Randy Kramer wrote: > On Wednesday 29 June 2005 10:30 am, hicinbothem@ems.att.com wrote: >>The summer POTM challenges you to write a program that will place up to >>26 pictures on a sheet of paper with the least amount of leftover >>space. > > Do you want to constrain the solutions a little more? A trivial solution that > wastes no paper (regardless of paper size) is to print 2 rows of 13 pictures, > and resize each picture to fit in that space. That's not a trivial solution at all, as almost the entire sheet of paper is then leftover space, assuming the pictures start off with a typical 3:2 aspect ratio. It's very easy to do far better than that. mathew