Https://ide.codingblocks.com/s/142671 sollution not working kindly help

https://ide.codingblocks.com/s/142671 sollution not working kindly help

Kartik, you are following a wrong approach in your code, I would suggest you to follow up on this video and make changes in your code accordingly,

i have already completed this topic
could u help me correcting my code

Kartik, plz make following changes in your code,
take the function as ,
long long int y=minimum_time(ar,N,K);
and then in this function , take
long long int lower=maximum(ar,N);
long long int upper=sum_of_array(ar,N);
and then check if,
if(painters<=K)
{
ans=mid;
upper=mid-1;
}
else
{
lower=mid+1;
}