Advertisement
semsem_elazazy

https://codeforces.com/contest/1675/problem/A

May 5th, 2022
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include <iostream>
  2. #include<bits/stdc++.h>
  3. #include<utility>
  4. #include <queue>
  5. #include <vector>
  6. #include <iterator>
  7. #include <set>
  8. #define ll long long
  9. #define ull unsigned long long
  10. #define pi  3.14159
  11.  
  12. #define OO  2000000000
  13. //#define ceil(w, m) (((w) / (m)) + ((w) % (m) ? 1 : 0))
  14. using namespace std;
  15.  
  16. void yasmeen_fakhri(){
  17.   ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
  18.   #ifndef ONLINE_JUDGE  
  19.     freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
  20.   #endif
  21. }
  22.  
  23.  
  24.  
  25. int main() {
  26.    yasmeen_fakhri();
  27.  
  28. ll t; cin>>t;
  29. while(t--){
  30.     ll a,b,c,x,y;
  31.   cin>>a>>b>>c>>x>>y;
  32.   if(x<=a && y<=b) cout<<"YES"<<"\n";
  33.   else if (c == 0 &&(x>a || y>b )) cout<<"NO"<<"\n";
  34.   else if ((x-a ) + (y-b) <= c) cout<<"YES"<<"\n";
  35.   else cout<<"NO"<<"\n";
  36. }
  37.    return 0;
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement