The logic I thought is that we need to increase the number of students recieving scholarship should be max.
So let’s say that max is some value z which lies between 0 and n (this value cannot be greater than number of students obviously).
So total coupons is z * x ------- 1
where x is the coupon required for getting scholarship.
This value will be less than or equal to m + (n - z) * y -----2
Where m is the coupon already given and y is the penality of students who have performed bad. I came up with eq 2 as we are already getting m coupons and the remaining students may or may not performing badly ie may not pay the penality.
But I’m failing some test cases . Please help me with that.