Wrong answer for the code


only test case 1 and 6 are showing correct answer rest are wrong .

Hi @manit123, you don’t have to return mid every time. Take another variable ans and update ans only in this condition:
if((mid*x)<=c){
start=mid+1;
ans=mid;
}
And then return ans in the end instead of mid.

If your doubt still persists, reply to this thread. Else, mark it as resolved.