can u plz tell what is wrong in this code
Related to cb scholarship divide and conquor question
#include
using namespace std;
int main()
{
int n,m,x,y;
cin>>n;
cin>>m;
std::cin >> x;
std::cin >> y;
int s=0;
int e=n-1,ans=0;
while(s<=e){
int mid=(s+e)/2;
if((mid*x)<=(m+((n-1-mid)*y)))
{
ans=mid;
s=mid+1;
}
else{
e=mid-1;
}
}
return ans;
std::cout << ans << std::endl;
return 0;
}
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.
