Coudlnt get what the question is trying to say

moreover there is only 1 test case given which doesnt explain much as all studednts are getting 100% scholarship in it

hey, refer this code -->

what would i do with the solution without understanding the question

so for that read the question…

According to the question,

  • Initially there are N students and M coupons
  • 100% wavier is given to those who have at least X coupons (good students)
  • Bad students must give Y coupons to take admission

So, let’s form an equation, If there are k good students then (N - k) students must have performed bad.

Initial Coupons - k*X + (N - k)*Y >= 0
Initial Coupons = M

You, just need to solve this equation by maximizing k such that k <= N

Hint: You can apply binary search for optimal k

1 Like

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.