Suppose you are in charge of a non-profit organization that receives donated gifts and distributes them to needy children. You are given a list of children with their ages (0 to 16 years old).  For each gift, you are given the following information: Retail price Size of gift (cubic feet) Range of suitable ages
Let: P = sum of retail prices of the gifts N = total number of children ei = | P/N – sum of retail prices for gifts given to child i | You must minimize Σ ei  for the N children, subject to the following constraints: 1. Each gift must be given to exactly one child. 2. No child may be given a gift that is not intended for their age. 3. Each child must receive at least one large and one medium gift, where 1 ft3 <= medium gift <= 2 ft3, and 2 ft3 < large gift. 4. The number of gifts received by each child can be no less than the average – 1 and no more than the average + 1.
Important: The sum of the e_i values MUST be the absolute lowest value that is possible for the given input file.