Unable to do the question


this is my code pls check and if possible
comment my mistake …

Hello @Shubham800 please wait checking your code:

@Shubham800 please check this:


i have commented the mistake:

Happy Learning!!

but we already have m coupons so i first distributed them

and then take remaining student to be applicable for the coupon

thnk u ,your code logic and my code logic both worked but i haven’t take long long int ie why it failed …

thnks a lot again for such fast replies .

@Shubham800 the major error was the e in the binarry where you were taking as s and yes the long long int was also the problem.
Happy Learning!!

https://ide.codingblocks.com/s/415416 i have taken same e as before pls check once ,it working fine

actually i intially deleted the students to which coupons can be given via already aviable coupons ie why my e was n-l;

@Shubham800
else
s=mid-1;
i am talking about this mistake in your code: here it should be
else e=mid-1;

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.