Sir/maam, I tried to make the code as efficient as possible, still tle for 2 test cases

hello @vageesha

optimise ur is possible function .
make it O(1).

bool isPossible(int n,int m,int x,int y,int mid){
     
     if(mid*x<=m+(n-mid)*y){
         return true;
     }
     return false;
}

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.