Please check where am i going wrong

code-https://ide.codingblocks.com/s/308930

Mistakes

  1. at line no 41 run while loop
    while(s<=e)

  2. correct condition

if(possible(mid, arr,n)<=p){
            e=mid-1;
		    ans=mid;
        }
        else if(possible(mid, arr, n)>p){
            s=mid+1;
        }
  1. at line no 25 first you have to take p and then n;

look at modified Code below

Modified Code

if you have some doubt regarding 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