what does the book allocation problem is conveying and please explain the sample input
Book allocation problem sample input
1
4 2
12 34 67 90
this is sample input
first line is no of testcase
4 is no of books
2 is no of student
12 34 67 90 it is no of pages in each book
now for 2 student we can assign
- 12 pages to first student and rest 191 pages to second
- (12+34)46 pages to first student and rest 157 pages to second
- (12+34+67)113 pages to first student and rest 90 pages to second
in these different combinations max no of pages read by any student are 191, 157,113 respectively now we have to minimize the max no of pages read by a student so we have to consider 3rd combination in which first student read 113 pages and second student read 90 pages
so ans to this sample input is 113
1 Like