3 test cases are not passing
Coupons distribution in coding blocks
int a = mid*x;
here, mid <= 1e9 and x <= 1e9
so, a <= 1e18 and int can store maximum upto 1e9(approx).
correct way,
long int a=mid*(long int)x;
long int b=m+(n-mid)*(long int)y;
You can refer to this article for maximum value of int.
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.