What is wrong with my code of book allocation

i’m not able to figure out what is wrong with my code. can anyone please help me to find the problem.
book allocation problem


ur logic in ischeck was wrong, that i have fixed, an dminimum no of pages is not zero but max of all pages because atleast one student has to read the book with max pages, right