Not able to find the mistake

#include
using namespace std;
bool isvalid(int arr[],int no_of_student,int no_of_books,int ans)
{
int std=1,current_pages=0;
for(int i=0;i<no_of_books;i++)
{

    if(current_pages>ans)
    {
        std++;
        current_pages=arr[i];
    }
    else
    {
        current_pages=current_pages+arr[i];
    }
    if(std>no_of_student)
    return false;
}
return true;

}
int main()
{
int no_of_books,no_of_student,sum=0;
cin>>no_of_books;
int arr[no_of_books];
for(int i=0;i<no_of_books;i++)
{
cin>>arr[i];
sum=sum+arr[i];
}
cin>>no_of_student;
int start =0,end=sum,final_ans,mid=0;
while(start<=end)
{
mid=(start+end)/2;
if(isvalid(arr,no_of_student,no_of_books,mid))
{
end=mid-1;
final_ans=mid;
}
else start=mid+1;

 }
 cout<<final_ans<<endl;

}

the start variable is wrongly initialised
it should be equal to maximum value in the array
start = max(start, arr[i])

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.