On today's TopCoder Single-Round Match, the following question was posed (the post-contest write-up hasn't arrived yet, and their explanations often leave much to be desired anyway, so I thought I'd ask here):
Given a maximum of 8 marbles and their radii, how would you put them next to each other on a line so that the distance between the lowest point on the leftmost marble and the lowest point on the rightmost marble is as small as possible?
8! is small enough number for brute forcing, so we can certainly try all permutations. However, could someone explain to me, preferably in diagrams, how to calculate that distance value given a configuration?
Also, any kind of background information would be appreciated.