Limits 1s, 512 MB
You brought CCC chocolates to a party where there are AAA adults and KKK kids. You know that an adult will always eat the chocolate fully and a kid will always eat the chocolate partially. For each chocolate, you know how much happiness it brings to one who eats fully or partially. You want to give everyone exactly one chocolate so that the total happiness they get is maximized.
This is a companion discussion topic for the original entry at https://toph.co/p/choco-fun