
A rectangular cake travels to a restaurant on a truck. On the way the truck hits a pothole, and the cake shatters into N perfectly rectangular pieces. Piece i has width wi and length li for 1≤i≤N.
At the restaurant the customer orders a replacement cake of the same size. The original order form was left unfinished, so only the width W of the cake is known. Every piece of the shattered cake was kept, so the areas of the pieces add up to the area of the original cake. Find the length L of the cake.
A piece may have turned while the cake broke, so wi can be larger than W.