my idea,
say, fruit1 is required to make person A and person B happy.
person A requires num1 number of fruit1 and person B requires num2 number of fruit1.
then required number of fruit1 is max( num1 , num2 )
similary if you can extend this to all who require it and calculate the max requirement for the fruit.
i.e max ( num1 , num2 , num3 , num4 .... numn )
cost involved in buying a fruit is ( maxrequirement for the fruit * cost of one fruit ).
sum of all such costs for all fruits is the answer.
hope this helps.
Thanks,
Arun.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups-beta.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---