@maddy: The students should be assigned consecutive books only. That is, u CANNOT assign book 1, 2 and 5 to a single student. either assign book 1, 2 and 3 or 1 and 2 or any such combination of consecutive numbers.
On Thursday, June 14, 2012 12:26:09 PM UTC+5:30, algogeek wrote: > > In a library there are N books with the number of pages in i th book given > by bi . These books are to be distributed among K students such that the > difference between the largest sum of pages in the books assigned to any > student and the smallest sum of number of pages in the books assigned to > any student is minimum for the given input. Also the books are arranged in > a certain order and this order must never be changed. > For eg: > suppose B[ ] contains the number of pages in each book. > then > N=6 > K=3 > B={3,7,8,2,6,4} > > then the output will be 0 as we can give book 1 and 2 to student 1 and > book 3 and 4 to student 2 and the remaining to student 3. That makes 10 > pages for student 1 10 for 2 and 10 for 3 and thus the difference is 0 > > similarly if B={3,6,8,2,6,4} then the minimum difference will be 1 . > > > > > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/7jAw-C4JI1AJ. 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.