Sir doubt in painters partition

sir can I get solution for this problem

hi @tejasddongare try to write the code yourself and we’ll be happy to help if you are stuck anywhere

#include
using namespace std;
bool is_possible(int mid,int total,int p)
{

}
int main()
{
int p,b,boards[1000],total=0;
cin>>p>>b;
for(int i=0;i<b;i++)
{
cin>>boards[i];
total=total+boards[i];
}
int start=1,end=total;
while(start<=end)
{
int mid=(start+end)/2;
if(is_possible(mid,total,p))
{
end=mid-1;
ans=mid;
}
else
{
start=mid+1;
}
}
}

#include
using namespace std;
bool is_possible(int mid,int total,int p)
{

}
int main()
{
int p,b,boards[1000],total=0;
cin>>p>>b;
for(int i=0;i<b;i++)
{
cin>>boards[i];
total=total+boards[i];
}
int start=1,end=total;
while(start<=end)
{
int mid=(start+end)/2;
if(is_possible(mid,total,p))
{
end=mid-1;
ans=mid;
}
else
{
start=mid+1;
}
}
}

sir can I get code for is_possible(). ?

@tejasddongare please share your code on cb ide

Mam i don’t have access to pc or laptop I m typing on my phone with c++ compiler apk and on phone I m not able to open coding blocks idle can I get code? As i m not able to understand the code of function to check how many painters can paint at an instant(mid)

@tejasddongare refer to this https://ide.codingblocks.com/s/20385

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.