fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4. #define dd double
  5. #define ld long double
  6. #define ull unsigned long long
  7. #define yes cout << "YES\n"
  8. #define no cout << "NO\n"
  9. #define el "\n"
  10. #define Arwa ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  11. #define fix(x) cout << fixed << setprecision(x)
  12. #define all(v) v.begin(),v.end()
  13. #define dpp(v,val) memset(v,val,sizeof(v))
  14. #define mod 1e9+7
  15. #define oo 1e9
  16. const int N = 1e5 + 5;
  17. int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } // log(n) __gcd(a,b)
  18. //todo اى ويل بريبير ماى بيبرز تو بى ذا بيست ان زيس وورلد
  19.  
  20. void HereWeGoAgain()
  21. {
  22. int n;
  23. cin>>n;
  24. int u,r,d,l;
  25. cin>>u>>r>>d>>l;
  26. if( (u<=1&&r==n&&l==n)||(r<=1&&d==n&&u==n)||(d<=1&&r==n&&l==n)||(l<=1&&d==n&&u==n) ||
  27. (u<1&&(r==n||l==n))||(r<1&&(d==n||u==n))||(d<1&&(r==n||l==n))||(l<1&&(d==n||u==n)) )
  28. no; else yes;
  29. }
  30. int32_t main()
  31. {
  32. Arwa
  33. int t=1;
  34. cin>>t;
  35. for(int i=1;i<=t;i++)
  36. {
  37. HereWeGoAgain();
  38. }
  39. return 0;
  40. }
Success #stdin #stdout 0.01s 5312KB
stdin
Standard input is empty
stdout
YES