what is wrongggggg in the codeeee
#include<bits/stdc++.h> using namespace std; #define ll long long int int main() { ll n,m,x,y; ll t; cin>>n>>m>>x>>y; t=m+y; ll s; if((t/x)>n) cout<<n; else cout<<t/x; return 0; }
Hi ankita
Please share your code in coding blocks ide in future.
You cannot add y to m simply. You need to think in terms of binary search.
Here is the corrected code:
Hope it helps
Give a like if you’re satisfied
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.