Winning CB scholarship

I tried this code but one test case is working

hello @mittali
what logic u are applying here?

actually mid student ki value hai jisko maine x se multiply kiya and check kiya ki agar vo m(total coupons) se km and equal hai toh acha hai nahi toh vo y se lele jo maine else if main kiya hai

agar hum example le 5 10 2 1 usme solve karke mid (5) print hoga toh inside true nahi hua toh vo mid print ho geya. agar example le 3 5 5 6 is me mid(3) answer nahi hai toh us me vo else break main jayega aur print sahi hoga

@mittali
dekho agar mid (student ko coupon mila hai) to iska matlab hua ki n-mid baccho se coupon liya hai.

to total coupoun jo collect hua hai wo -> M (already given)+ (N-MID) * Y (coupon paid by failed students)

ab hame inko MID student me tabhi baat sakte hai jab
MID * x (need) <= M+(N-MID) * y (availability) hona chaiya.

bus tumko isi pe binary seach lagana hai aur mid ko maximize karna hai

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.