Codeforces 1256A - Payment Without Change Solution
Solution in C++:
///La ilaha illellahu muhammadur rasulullah
///******Bismillahir-Rahmanir-Rahim******///
///AH Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- long long n,a,b,s,t;
- cin>>t;
- while(t--)
- {
- cin>>a>>b>>n>>s;
- if((((a*n)+b)>=s)&&(s%n<=b))
- cout<<"YES"<<endl;
- else
- cout<<"NO"<<endl;
- }
- }
No comments