Book allocation problem doubt

i have a doubt in the last line question did not understand the question clear crystal pls help me in a easy way what is the aim in this question
maximum no of pages assigned to student is minimum
that i understand pls give a explaination with example
asap

here i am explaining the Problem and its solution

Problem:
You have to find the minimize the number of pages assingned to student
and then print the max number of pages 1 student have to read

Explanation

pages[] = {12, 34, 67, 90}
No of students = 2

There are 2 number of students. pages can be distributed in following fashion :

  1. [12] and [34, 67, 90]
    Max number of pages is allocated to student
    2 with 34 + 67 + 90 = 191 pages
    so max no of pages student have to read is 191
    and we have to minimize this

  2. [12, 34] and [67, 90]
    Max number of pages is allocated to student
    2 with 67 + 90 = 157 pages

  3. [12, 34, 67] and [90]
    Max number of pages is allocated to student
    1 with 12 + 34 + 67 = 113 pages

from the above distribution we can say that maximum number of pages assigned to a student is 113 so this is our ans

so we have to minimize the max no of pages assigned to 1 student
after that if we get the max no of pages read by 1 student

and to find the max no of pages assigned to student(minimized) we can use binary search

look at reference Code
Reference Code

if you want to ask something about this feel free to ask
i hope this helps
if yes show your response with :heart: and don’t forgot to mark doubt as resolved

1 Like


pls check my code i am stuck didnt find my mistake in the code
as if n=4,m=2 arr[]={10,20,3,40}
ans=60
pls correct my mistake and tell me where i am wrong

doubt resolved sir thanks for the help sir ji

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.