➤ Problem Link : 1256A. Payment Without Change
✅ C++ Solution :
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
int q;
cin>>q;
while(q--)
{
double a,b,n,s;
cin>>a>>b>>n>>s;
ll mx=min(a,(ll)s/n);
ll mn=(ceil)((s-b)/n);
// cout<<mn<<" "<<mx<<endl;
if(mn<=mx)
cout<<"YES\n";
else
cout<<"NO\n";
}
}
Thank you for your patience reading. If you enjoyed this post, I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Whatsapp or Facebook.
😇Happy Learning!!
