@ Dave: Disregard what I wrote!!
The algorithm that I developed after works as follows: We can recursively define the maximum number of bananas brought by the elephant by D km starting with V bananas: banana (V, D) = max (V-D, banana (V - min (V, 1000), D) + min (V, 1000) -2 * D) banana (banana (V, j), D-j), 1 <= j <D As the number of recursive calls is quite large, memorize a few values. Some values calculated by the algorithm banana (initial D) banana (3000,100) = 2500 banana (3000,200) = 2000 banana (3000,300) = 1700 banana (3000,400) = 1.400 banana (3000,500) = 1100 banana (3000,600) = 933 banana (3000,700) = 833 banana (3000,800) = 733 banana (3000,900) = 633 banana (3000,1000) = 533 Wladimir Araujo Tavares *Federal University of Ceará * On Sun, May 22, 2011 at 4:04 PM, Dave <dave_and_da...@juno.com> wrote: > @Wladimir: I don't understand what you are saying. If the first cache > of bananas is established x km from the starting spot, with x <= 500, > the elephant can deliver 3,000 - 5*x bananas to that cache. In your > case, x = 250, so the elephant can deliver 1,750 bananas. > > Dave > > On May 20, 11:56 pm, Wladimir Tavares <wladimir...@gmail.com> wrote: > > Consider the following scenario: > > On the first trip, the elephant carries 1000 bananas. the elephant walk > 250 > > km consuming 250 bananas left in position 250 (500 bananas). After that, > he > > goes back over 250 Km eating more bananas 250 bananas. On the second > trip, > > the elephant carries 1000 bananas again, walk 250 km, carrying over 250 > > bananas and arrives at B with 250 bananas. More he can not go back just > > because finish bananas. > > ok? > > Wladimir Araujo Tavares > > *Federal University of Ceará > > > > * > > > > > > > > On Sat, May 21, 2011 at 1:27 AM, Dave <dave_and_da...@juno.com> wrote: > > > @Wladimir: According to the problem statement, the elephant starts out > > > with 3,000 bananas. I am saying that the elephant can deliver 534 > > > bananas to the destination 1,000 km away. > > > > > Dave > > > > > On May 20, 7:22 pm, Wladimir Tavares <wladimir...@gmail.com> wrote: > > > > with 534 , the elephant can travel only 534 Km! I am right? > > > > Wladimir Araujo Tavares > > > > *Federal University of Ceará > > > > > > * > > > > > > On Fri, May 20, 2011 at 8:36 PM, Dave <dave_and_da...@juno.com> > wrote: > > > > > Upon reading the problem more carefully, the answer is 534 bananas, > > > > > not 533-1/3. > > > > > > > Dave > > > > > > > On May 20, 3:43 pm, Dave <dave_and_da...@juno.com> wrote: > > > > > > @Bhavesh: 533-1/3. > > > > > > > > Dave > > > > > > > > On May 20, 10:47 am, Bhavesh agrawal <agr.bhav...@gmail.com> > wrote: > > > > > > > > > 1 elephant can take 1000 banana at a time and eat 1 banana > after > > > each > > > > > 1km > > > > > > > travel. > > > > > > > total bananas are 3000 and distance have to travel from A to B > is > > > > > 1000km. > > > > > > > > > So how many max bananas he can take from A to B. (he'll eat > in > > > return > > > > > > > travel too)- Hide quoted text - > > > > > > > > - Show quoted text - > > > > > > > -- > > > > > 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?hl=en.-Hide quoted text - > > > > > > - Show quoted text - > > > > > -- > > > 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?hl=en.- Hide quoted text - > > > > - Show quoted text - > > -- > 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?hl=en. > > -- 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?hl=en.