Average Price Algorithmby camelcom (Sexton)
|on Jan 28, 2009 at 08:51 UTC||Need Help??|
camelcom has asked for the wisdom of the Perl Monks concerning the following question:
Most esteemed monks...
I humbly ask for guidance in the following matter...
I buy some commodity at the following prices:
Qty @ Price
The average of these (150) fragments is 93.92666667.
These fragments need to be allocated to 5 people in the following quantities:
How do I allocate the fragments as fairly as possible such that the average price for each person is closest to the overall average?