fork(1) download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. cin >> t;
  7. while(t--)
  8. {
  9. int n;
  10. cin >> n;
  11. vector<int> v;
  12. for(int i=0;i<n;i++)
  13. {
  14. int a;
  15. cin >> a;
  16. v.push_back(a);
  17. }
  18. bool ispos = true;
  19. for(int i=0;i<n;i++)
  20. {
  21. if(v[i]<=2*(max(i,n-i-1)));
  22. {
  23. ispos = false;
  24. break;
  25. }
  26. }
  27. if(ispos) cout << "YES" << endl;
  28. else cout << "NO" << endl;
  29. }
  30. return 0;
  31. }
Success #stdin #stdout 0s 5316KB
stdin
5
2
4 10
2
2 2
3
4 10 5
3
5 3 5
5
12 13 25 17 30
stdout
NO
NO
NO
NO
NO