Hi, Please let me know is there any standard algorithm to solve the below mentioned problem.
Problem statement: I am having 10 apples and 4 basket each basket capacity is as mentioned below: Basket1 : capacity can hold maximum of 2 apples Basket2 : capacity can hold maximum of 4 apples Basket3 : capacity can hold maximum of 6 apples Basket4 : capacity can hold maximum of 8 apples I want to distribute the apples based on percentage contribution of each basket to total number of apples can accommodate by all the basket For the above example the 10 apples can be distributed as follows: 1 apple for basket1 (10% => (<basket1 capacity>/< total of all basket capacity>) *100 => (2/20) *100) 2 apple for basket1(20% =>(<basket2 capacity>/< total of all basket capacity>) *100 => (4/20) *100) 3 apples for basket 3(30% => (<basket3 capacity>/< total of all basket capacity>) *100 => (6/20) *100) 4 apples for basket 4(40% => (<basket4 capacity>/< total of all basket capacity>) *100 => (8/20) *100) In the above example what if I have 13 apples? What is the best approach to solution which is near to optimal balance? I request you to provide the idea to resolve this problem. Thanks & Regards, Sandeep --~--~---------~--~----~------------~-------~--~----~ 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 algogeeks+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---