My code is passing only 1 test case (TEST CASE 0) please tell whats wrong in it.
Winning CB scholarship
Sir , What was wrong in my code, except the data types long long.
if(X*mid<=M+(N-mid)*Y)
here u had written N-1, while it should be N-mid… rest just make long long int, ur code will work fine…
Thank u sir , the doubt is clear , just wanted to ask that shouldn’t we make the start, end and mid variables long long also , as if N is a large number then due to binary search start and end variables may become large.
Yes u should make them also long long int… But test cases uploaded for this ques are such that without making long long int also all test cases are passing…
Ok, doubt clear , Thanking you.
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.