fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int t;
  7. cin >> t;
  8. while(t--){
  9. int n;
  10. cin >> n;
  11. int x[n];
  12. for(int i=0;i<n;i++){
  13. cin >> x[i];
  14. }
  15. //cout << x[1] - x[0] << endl;
  16. if(n > 2 || (x[1] - x[0]) <= 1)
  17. cout << "NO\n";
  18. else
  19. cout << "YES\n";
  20. }
  21. }
  22.  
Success #stdin #stdout 0.01s 5268KB
stdin
3
2
3 8
2
5 6
6
1 2 3 4 5 10
stdout
YES
NO
NO