please provide with solution
Not able to solve the question please explain and give code
i dont understand the logic please comment it and explain it too
hi @akshat1409,
- 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
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.