Advertisement
Guest User

Untitled

a guest
Dec 29th, 2019
4,524
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #ifdef DEBUG
  2. #define _GLIBCXX_DEBUG
  3. #endif
  4. #pragma GCC optimize("O3")
  5. #include <bits/stdc++.h>
  6. using namespace std;
  7. typedef long double ld;
  8. typedef long long ll;
  9. const int maxN = (int)3e5 + 100;
  10. int a[maxN];
  11. int main() {
  12. ios_base::sync_with_stdio(false);
  13. cin.tie(nullptr);
  14. //freopen("input.txt", "r", stdin);
  15. int tst;
  16. cin >> tst;
  17. while (tst--) {
  18. int n;
  19. cin >> n;
  20. for (int i = 1; i <= n; i++) cin >> a[i];
  21. bool fnd = false;
  22. for (int i = 1; i + 1 <= n; i++) {
  23. if (abs(a[i + 1] - a[i]) > 1) {
  24. cout << "YES" << '\n' << i << " " << i + 1 << '\n';
  25. fnd = true;
  26. break;
  27. }
  28. }
  29. if (!fnd) cout << "NO" << '\n';
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement