Advertisement
jakaria_hossain

codeforces - a cookie for you

Jul 1st, 2020
1,088
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define fast()(ios_base::sync_with_stdio(0),cin.tie(NULL));
  5. #define eb emplace_back
  6. #define pi pair<ll,ll>
  7. #define mp make_pair
  8. int main()
  9. {
  10.     ll t;
  11.     cin>>t;
  12.     while(t--)
  13.     {
  14.         ll v,c,f,s;
  15.         cin>>v>>c>>f>>s;
  16.         bool fl=false;
  17.         ll mn =min(v,c);
  18.         if(mn>=s)
  19.         {
  20.             if(v>c)c-=min(mn,s);
  21.             else v-=min(mn,s);
  22.             s=0;
  23.         }
  24.  
  25.  
  26.         if(s>0)
  27.         {
  28.             cout<<"No"<<endl;
  29.         }
  30.  
  31.         else
  32.         {
  33.             //cout<<f<<" first"<<endl;
  34.             if(v+c>=f)fl=false;
  35.             else fl =true;
  36.             if(fl)cout<<"No"<<endl;
  37.             else cout<<"Yes"<<endl;
  38.         }
  39.  
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement