why is it not passing for all test cases?
https://onlinegdb.com/oMlIXfjJr
you have done mistake in if condition
your condition
if(mid <= (M + Y*(N-mid)))
Correct Condition
if(mid*X <= (M + Y*(N-mid)))
check Modified Code below
now it is passing all testcases
kindly give feedback from below link
it hardly takes a min
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.