Still showing same problem,pls check

#include
#define ll long long
bool cowplace(ll int a[],ll int n,ll int c,ll int mid )
{
ll int lastcow=a[0];
ll int count=1;
for(int i=0;i<n;i++)
{
if(a[i]-lastcow>=mid)
lastcow=a[i];
count++;
if(count==0)
{
return true;
}
}
return false;
}
using namespace std;
int main()
{
ll int n,c;
cin>>n;
ll int a[n];
cin>>c;
for(int i=0;i<n;i++)
cin>>a[i];
ll int s=0;
ll int e=a[n-1]-a[0];
ll int ans=0;
while(s<=e)
{
ll int mid=(s+e)/2;
bool cowplaced=cowplace(a,n,c,mid);
if(cowplaced)
{
ans=mid;
s=mid+1;
}
else
{
e=mid-1;
}
}
return 0;
}

hello @sneha23
pls share ur code using cb ide

@sneha23
check ur updated code->

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.