/*
██╗  ██╗   ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗
██║ ██╔╝   ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗
█████╔╝    █████╔╝ ███████║███████║██║     █████╗  ██║  ██║
██╔═██╗    ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║
██║  ██╗██╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝
╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define ss cout<<endl;system("pause");
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
const int oo = 0x3f3f3f3f, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//x = xDegrees*3.14159265 / 180;
//r.erase(remove(all(r), '&'), r.end());
//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);
//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
ll OO = (1LL * oo*oo);
void K_K()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
ll gcd(ll a, ll b) {
	return b == 0 ? abs(a) : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

int main(){
	K_K();
	ll t;
	cin >> t;
	while (t--){
		ll n, l = 0, r = 0;
		cin >> n;
		vector<pair<ll,ll>>v(n);
		for (int i = 0; i < n; i++)cin >> v[i].first, v[i].second = i;
		sort(all(v));
		bool flag = 0;
		for (int i = 0; i < n; i++){
			for (int j = i + 1; j < n; j++){
				if ( abs(v[i].first - v[j].first) >= abs(v[i].second - v[j].second) + 1) {
					l = v[j].second;
					r = v[i].second;
					flag = 1;
					break;
				}
			}
		}
		if (l>r)swap(l, r);
		if (flag)cout << "YES\n" << l + 1 << " " << r + 1 << endl;
		else cout << "NO\n";
	}
}


/*
██╗  ██╗   ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗
██║ ██╔╝   ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗
█████╔╝    █████╔╝ ███████║███████║██║     █████╗  ██║  ██║
██╔═██╗    ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║
██║  ██╗██╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝
╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define ss cout<<endl;system("pause");
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
const int oo = 0x3f3f3f3f, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//x = xDegrees*3.14159265 / 180;
//r.erase(remove(all(r), '&'), r.end());
//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);
//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
ll OO = (1LL * oo*oo);
void K_K()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
ll gcd(ll a, ll b) {
	return b == 0 ? abs(a) : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

int main(){
	K_K();
	ll t;
	cin >> t;
	while (t--){
		ll n, mx = -1, mn = OO, l = 0, r = 0;
		cin >> n;
		vector<ll>v(n);
		bool flag = 0;
		for (int i = 0; i < n; i++)cin >> v[i];
		for (int i = 0; i < n; i++){
			if (v[i]>mx){
				mx = v[i];
				l = i + 1;
			}
			if (v[i] < mn){
				mn = v[i];
				r = i + 1;
			}
			if (mx - mn >= n){
				flag = 1;
				break;
			}
		}
		if (l>r)swap(l, r);
		if (flag)cout << "YES\n" << l << " " << r << endl;
		else cout << "NO\n";
	}
}


/*
██╗  ██╗   ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗
██║ ██╔╝   ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗
█████╔╝    █████╔╝ ███████║███████║██║     █████╗  ██║  ██║
██╔═██╗    ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║
██║  ██╗██╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝
╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define ss cout<<endl;system("pause");
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
const int oo = 0x3f3f3f3f, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//x = xDegrees*3.14159265 / 180;
//r.erase(remove(all(r), '&'), r.end());
//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);
//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
ll OO = (1LL * oo*oo);
void K_K()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
ll gcd(ll a, ll b) {
	return b == 0 ? abs(a) : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

int main(){
	K_K();
	ll t;
	cin >> t;
	while (t--){
		ll n;
		cin >> n;
		vector<ll>v(n);
		for (int i = 0; i < n; i++)cin >> v[i];
		ll l = -1, r = 0, mx = -1, mn = OO;
		bool flag = 0;
		while (++l <= r){
			while (r+1 < n && ((mx - mn) < n)){
				mx = max(mx, v[r]);
				mn = min(mn, v[r]);
				r++;
			}
			mx = max(mx, v[r]);
			mn = min(mn, v[r]);
			if ((mx - mn) >= n){
				flag = 1;
				break;
			}
			if (v[l] == mx){
				mx = -1;
				for (int i = l + 1; i <= r; i++)
					mx = max(mx, v[i]);
			}
			if (v[l] == mn){
				mn = OO;
				for (int i = l + 1; i <= r; i++)
					mn = min(mn, v[i]);
			}
		}
		if (flag)cout << "YES\n" << l + 1 << " " << r + 1 << endl;
		else cout << "NO\n";
	}
}


/*
██╗  ██╗   ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗
██║ ██╔╝   ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗
█████╔╝    █████╔╝ ███████║███████║██║     █████╗  ██║  ██║
██╔═██╗    ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║
██║  ██╗██╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝
╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define ss cout<<endl;system("pause");
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
const int oo = 0x3f3f3f3f, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//x = xDegrees*3.14159265 / 180;
//r.erase(remove(all(r), '&'), r.end());
//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);
//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
ll OO = (1LL * oo*oo);
void K_K()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
ll gcd(ll a, ll b) {
	return b == 0 ? abs(a) : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

int main(){
	K_K();
	ll t;
	cin >> t;
	while (t--){
		ll n;
		cin >> n;
		vector<ll>v(n);
		for (int i = 0; i < n; i++)cin >> v[i];
		ll l = -1, r = -1, mx = -1, mn = OO;
		bool flag = 0;
		while (l <= r){
			while (r + 1 < n && ((mx - mn) < n)){
				r++;
				mx = max(mx, v[r]);
				mn = min(mn, v[r]);
			}
			if ((mx - mn) >= n){
				flag = 1;
				break;
			}
			l++;
			if (l>r)break;
			mx = v[l];
			mn = v[l];
			r = l;
		}
		if (l == -1)l = 0;
		if (r == n)r = n - 1;
		if (flag)cout << "YES\n" << l + 1 << " " << r + 1 << endl;
		else cout << "NO\n";
	}
}


/*
██╗  ██╗   ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗
██║ ██╔╝   ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗
█████╔╝    █████╔╝ ███████║███████║██║     █████╗  ██║  ██║
██╔═██╗    ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║
██║  ██╗██╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝
╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define ss cout<<endl;system("pause");
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
const int oo = 0x3f3f3f3f, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//x = xDegrees*3.14159265 / 180;
//r.erase(remove(all(r), '&'), r.end());
//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);
//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
ll OO = (1LL * oo*oo);
void K_K()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
ll gcd(ll a, ll b) {
	return b == 0 ? abs(a) : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

int main(){
	K_K();
	ll t;
	cin >> t;
	while (t--){
		ll n,ans;
		cin >> n;
		bool flag=0;
		vector<ll>v(n);
		for (int i = 0; i < n; i++)cin >> v[i];
		for(int i=1;i<n;i++){
		    if(abs(v[i]-v[i-1])>1){
		        flag=1;
		        ans=i;
		        break;
		    }
		}
		if (flag)cout << "YES\n" << ans << " " << ans + 1 << endl;
		else cout << "NO\n";
	}
}


/*
██╗  ██╗   ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗
██║ ██╔╝   ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗
█████╔╝    █████╔╝ ███████║███████║██║     █████╗  ██║  ██║
██╔═██╗    ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║
██║  ██╗██╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝
╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define ss cout<<endl;system("pause");
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
const int oo = 0x3f3f3f3f, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//x = xDegrees*3.14159265 / 180;
//r.erase(remove(all(r), '&'), r.end());
//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);
//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
ll OO = (1LL * oo*oo);
void K_K()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
ll gcd(ll a, ll b) {
	return b == 0 ? abs(a) : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

int main(){
	K_K();
	ll t;
	cin >> t;
	while (t--){
		ll n;
		cin >> n;
		vector<ll>v(n);
		for (int i = 0; i < n; i++)cin >> v[i];
		ll l = -1, r = -1, mx = -1, mn = 1e10;
		bool flag = 0;
		while (l <= r){
			while (r + 1 < n && ((mx - mn) < n)){
				r++;
				mx = max(mx, v[r]);
				mn = min(mn, v[r]);
			}
			mx = max(mx, v[r]);
			mn = min(mn, v[r]);
			if ((mx - mn) >= n){
				flag = 1;
				break;
			}
			l++;
			if (l>r)
				break;
			mx = v[l];
			mn = v[l];
			r = l;
		}
		if (l == -1)l = 0;
		if (r == n)r = n - 1;
		if (flag)cout << "YES\n" << l + 1 << " " << r + 1 << endl;
		else cout << "NO\n";
	}
}


/*
██╗  ██╗   ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗
██║ ██╔╝   ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗
█████╔╝    █████╔╝ ███████║███████║██║     █████╗  ██║  ██║
██╔═██╗    ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║
██║  ██╗██╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝
╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define ss cout<<endl;system("pause");
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
const int oo = 0x3f3f3f3f, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//x = xDegrees*3.14159265 / 180;
//r.erase(remove(all(r), '&'), r.end());
//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);
//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
ll OO = (1LL * oo*oo);
void K_K()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
ll gcd(ll a, ll b) {
	return b == 0 ? abs(a) : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

int main(){
	K_K();
	ll t;
	cin >> t;
	while (t--){
		ll n;
		cin >> n;
		vector<ll>v(n+1);
		for (int i = 1; i <= n; i++)cin >> v[i];
		ll l = 0, r = 0, mx = -1, mn = OO;
		bool flag = 0;
		while (l <= r){
			while (r + 1 <= n && ((mx - mn) < ((r-l)+1) )){
				r++;
				mx = max(mx, v[r]);
				mn = min(mn, v[r]);
			}
			if (((mx - mn) >= ((r - l) + 1))){
				flag = 1;
				break;
			}
			l++;
			if (l>r)break;
			if (v[l] == mx){
				mx = -1;
				for (int i = l + 1; i <= r; i++)
					mx = max(mx, v[i]);
			}
			if (v[l] == mn){
				mn = OO;
				for (int i = l + 1; i <= r; i++)
					mn = min(mn, v[i]);
			}
			if ((mx - mn) >= n){
				flag = 1;
				break;
			}
		}
		if (l == -1)l = 0;
		if (r == n)r = n - 1;
		if (flag)cout << "YES\n" << l + 1 << " " << r + 1 << endl;
		else cout << "NO\n";
	}
}


/*
██╗  ██╗   ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗
██║ ██╔╝   ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗
█████╔╝    █████╔╝ ███████║███████║██║     █████╗  ██║  ██║
██╔═██╗    ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║
██║  ██╗██╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝
╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define ss cout<<endl;system("pause");
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
const int oo = 0x3f3f3f3f, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//x = xDegrees*3.14159265 / 180;
//r.erase(remove(all(r), '&'), r.end());
//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);
//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
ll OO = (1LL * oo*oo);
void K_K()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
ll gcd(ll a, ll b) {
	return b == 0 ? abs(a) : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

int main(){
	K_K();
	ll t;
	cin >> t;
	while (t--){
		ll n;
		cin >> n;
		vector<ll>v(n);
		for (int i = 0; i < n; i++)cin >> v[i];
		ll l = -1, r = -1, mx = -1, mn = OO;
		bool flag = 0;
		while (l <= r){
			while (r + 1 < n && ((mx - mn) < n)){
				r++;
				mx = max(mx, v[r]);
				mn = min(mn, v[r]);
			}
			if ((mx - mn) >= n){
				flag = 1;
				break;
			}
			l++;
			if (l>r)break;
			if (v[l] == mx){
				mx = -1;
				for (int i = l + 1; i <= r; i++)
					mx = max(mx, v[i]);
			}
			if (v[l] == mn){
				mn = OO;
				for (int i = l + 1; i <= r; i++)
					mn = min(mn, v[i]);
			}
			if ((mx - mn) >= n){
				flag = 1;
				break;
			}
		}
		if (l == -1)l = 0;
		if (r == n)r = n - 1;
		if (flag)cout << "YES\n" << l + 1 << " " << r + 1 << endl;
		else cout << "NO\n";
	}
}


/*
██╗  ██╗   ██╗  ██╗██╗  ██╗ █████╗ ██╗     ███████╗██████╗
██║ ██╔╝   ██║ ██╔╝██║  ██║██╔══██╗██║     ██╔════╝██╔══██╗
█████╔╝    █████╔╝ ███████║███████║██║     █████╗  ██║  ██║
██╔═██╗    ██╔═██╗ ██╔══██║██╔══██║██║     ██╔══╝  ██║  ██║
██║  ██╗██╗██║  ██╗██║  ██║██║  ██║███████╗███████╗██████╔╝
╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝  ╚═╝╚══════╝╚══════╝╚═════╝
*/
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include<unordered_map>
#define endl "\n"
#define Ceil(x,y) ((x+y-1)/y)
#define ss cout<<endl;system("pause");
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define rt(s) return cout<<s,0
#define watch(x) cout<<(#x)<<" = "<<x<<endl
#define sz(s)	(int)(s.size())
const int oo = 0x3f3f3f3f, mod = 1e9 + 7;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//x = xDegrees*3.14159265 / 180;
//r.erase(remove(all(r), '&'), r.end());
//ef1tn=(( (n / 2)*( (n / 2) + 1) / 2) * 2);
//of1tn=(n * (n + 1) / 2 - 2 * ((n / 2) * (n / 2 + 1) / 2));
int dx[] { 1, -1, 0, 0, 1, 1, -1, -1 };
int dy[] { 0, 0, 1, -1, 1, -1, 1, -1 };
ll OO = (1LL * oo*oo);
void K_K()
{
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif  !ONLINEJUDGE
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
ll gcd(ll a, ll b) {
	return b == 0 ? abs(a) : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

int main(){
	K_K();
	ll t;
	cin >> t;
	while (t--){
		ll n;
		bool flag=0;
		cin >> n;
		vector<ll>v(n+1);
		for (int i = 1; i <= n; i++)cin >> v[i];
		for(int i=2;i<=n;i++){
		    if(abs(v[i]-v[i-1])>1){
		        flag=1;
		        break;
		    }
		}
		if (flag)cout << "YES\n" << l + 1 << " " << r + 1 << endl;
		else cout << "NO\n";
	}
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> brr[i];
		}

		for(int i = 0; i < n;i++){
			for(int j = n-1; j > i; j--){
				sort(brr+i, brr+j);
				if(brr[j] - brr[i] >= (j - i)+1){
					cout << "YES" << endl;
					cout << i+1 << " " << j+1 << endl;
					x = 1;
					break;
				}
			}
			if(x == 1)break;
		}
		if(x == 0){
			cout << "NO" << endl;
		}

	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		for(int i = 0; i < n-1; i++){
			if(arr[i+1] - arr[i] >= 2){
				cout << "YES" << endl;
				cout << i+1 << " " << i+2 << endl;
				x = 1;
				break;
			}
		}
		if(x == 0){
			cout << "NO"<< endl;
		}

	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		sort(arr, arr+ n);
		if(arr[n-1] - arr[0] >= n){
			cout << "YES" << endl;
			for(int i = 0; i < n;i++){
				for(int j = i+ 1; j < n; j++){
					ll m = max(brr[i],brr[j]);
					ll mi = min(brr[i], brr[j]);
					if(m - mi >= (j - i)+1){
						cout << i+1 << " " << j+1 << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		sort(arr, arr+ n);
		if(arr[n-1] - arr[0] >= n){
			cout << "YES" << endl;
			for(int i = 0; i < n;i++){
				for(int j = i+ 1; j < n; j++){
					ll m = max(brr[i],brr[j]);
					ll mi = min(brr[i], brr[j]);
					if(m - mi >= (j - i)+1){
						cout << i+1 << " " << j+1 << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
		}else{
			cout << "NO" << endl;
			for(int i = 0; i < n;i++){
				for(int j = i+ 1; j < n; j++){
					ll m = max(brr[i],brr[j]);
					ll mi = min(brr[i], brr[j]);
					if(m - mi >= (j - i)+1){
						cout << i+1 << " " << j+1 << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		sort(arr, arr+ n);
		if(arr[n-1] - arr[0] >= n){
			cout << "YES" << endl;
			for(int i = 0; i < n;i++){
				for(int j = i+ 1; j < n; j++){
					ll m = max(brr[i],brr[j]);
					ll mi = min(brr[i], brr[j]);
					if(m - mi >= (j - i)+1){
						cout << i+1 << " " << j+1 << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
		}else{
			for(int i = 0; i < n;i++){
				for(int j = i+ 1; j < n; j++){
					ll m = max(brr[i],brr[j]);
					ll mi = min(brr[i], brr[j]);
					if(m - mi >= (j - i)+1){
						cout << i+1 << " " << j+1 << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
			cout << "NO" << endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		int arr[n+5];
		int brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		sort(arr, arr+ n);
		if(arr[n-1] - arr[0] >= n){
			cout << "YES" << endl;
			for(int i = 0; i < n;i++){
				for(int j = i+ 1; j < n; j++){
					sort(brr+i, brr+j);
					if(arr[j] - arr[i] >= (j - i)){
						cout << i << " " << j << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		int arr[n+5];
		int brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		sort(arr, arr+ n);
		if(arr[n-1] - arr[0] >= n){
			cout << "YES" << endl;
			for(int i = 0; i < n;i++){
				for(int j = i+ 1; j < n; j++){
					sort(brr+i, brr+j);
					if(arr[j] - arr[i] >= (j - i)){
						cout << i+1 << " " << j+1 << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		sort(arr, arr+n);
		if(arr[n-1]  - arr[0] >= n){
			for(int i = 0; i < n;i++){
				for(int j = n-1; j > i; j--){
					ll m = max(brr[i],brr[j]);
					ll mi = min(brr[i], brr[j]);
					if(m - mi >= (j - i)+1){
						cout << "YES" << endl;
						cout << i+1 << " " << j+1 << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
			if(x == 0){
			cout << "NO" << endl;
			}
		}else{
			cout << "NO" << endl;
				for(int i = 0; i < n;i++){
				for(int j = n-1; j > i; j--){
					ll m = max(brr[i],brr[j]);
					ll mi = min(brr[i], brr[j]);
					if(m - mi >= (j - i)+1){
						cout << "YES" << endl;
						cout << i+1 << " " << j+1 << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
		}

	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		for(int i = 0; i < n-1; i++){
			if(abs(arr[i] - arr[i+1] )>= 2){
				cout << "YES" << endl;
				cout << i+1 << " " << i+2 << endl;
				x = 1;
				break;
			}
		}
		if(x == 0){
			cout << "NO"<< endl;
		}

	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}

		for(int i = 0; i < n;i++){
			for(int j = n-1; j > i; j--){
				ll m = max(brr[i],brr[j]);
				ll mi = min(brr[i], brr[j]);
				if(m - mi >= (j - i)+1){
					cout << "YES" << endl;
					cout << i+1 << " " << j+1 << endl;
					x = 1;
					break;
				}
			}
			if(x == 1)break;
		}
		if(x == 0){
			cout << "NO" << endl;
		}

	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n-1; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		for(int i = 0; i < n; i++){
			if(abs(arr[i+1] - arr[i] )>= 2){
				cout << "YES" << endl;
				cout << i+1 << " " << i+2 << endl;
				x = 1;
				break;
			}
		}
		if(x == 0){
			cout << "NO"<< endl;
		}

	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}

		for(int i = 0; i < n;i++){
			for(int j = i+ 1; j < n; j++){
				ll m = max(brr[i],brr[j]);
				ll mi = min(brr[i], brr[j]);
				if(m - mi >= (j - i)+1){
					cout << "YES" << endl;
					cout << i+1 << " " << j+1 << endl;
					x = 1;
					break;
				}
			}
			if(x == 1)break;
		}
		if(x == 0){
			cout << "NO" << endl;
		}

	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> brr[i];
		}

		for(int i = 0; i < n-1;i++){
			if(brr[i+1] - brr[i] >= 2){
				cout << "YES" << endl;
				cout << i+1 << " " << i+2 << endl;
				x = 1;
				break;
			}
		}
		if(x == 0){
			cout << "NO" << endl;
		}

	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		sort(arr, arr+ n);
		if(arr[n-1] - arr[0] >= n){
			cout << "YES" << endl;
			for(int i = 0; i < n;i++){
				for(int j = i+ 1; j < n; j++){
					sort(brr+i, brr+j);
					if(brr[j] - brr[i] >= (j - i)+1){
						cout << i+1 << " " << j+1 << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		for(int i = 0; i < n; i++){
			if(arr[i+1] - arr[i] >= 2){
				cout << "YES" << endl;
				cout << i+1 << " " << i+2 << endl;
				x = 1;
				break;
			}
		}
		if(x == 0){
			cout << "NO"<< endl;
		}

	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		int arr[n+5];
		int brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		sort(arr, arr+ n);
		if(arr[n-1] - arr[0] >= n){
			cout << "YES" << endl;
			for(int i = 0; i < n;i++){
				for(int j = i+ 1; j < n; j++){
					if(arr[j] - arr[i] >= (j - i)){
						cout << 1 << " " << n << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	ll test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		ll	arr[n+5];
		ll brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		sort(arr, arr+n);
		if(arr[n-1]  - arr[0] >= n){
			for(int i = 0; i < n;i++){
				for(int j = n-1; j > i; j--){
					ll m = max(brr[i],brr[j]);
					ll mi = min(brr[i], brr[j]);
					if(m - mi >= (j - i)+1){
						cout << "YES" << endl;
						cout << i+1 << " " << j+1 << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
			if(x == 0){
			cout << "NO" << endl;
			}
		}else{
			cout << "NO" << endl;
		}

	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
	int test, x = 0;
	cin >> test;
	while(test--){
		x = 0;
		int n;
		cin >> n;
		int arr[n+5];
		int brr[n+5];
		for(int i = 0; i < n; i++){
			cin >> arr[i];
			brr[i] = arr[i];
		}
		sort(arr, arr+ n);
		if(arr[n-1] - arr[0] >= n){
			cout << "YES" << endl;
			for(int i = 0; i < n;i++){
				for(int j = i+ 1; j < n; j++){
					if(arr[j] - arr[i] >= (j - i)){
						//sort(brr[i])
						cout << i << " " << j << endl;
						x = 1;
						break;
					}
				}
				if(x == 1)break;
			}
		}else{
			cout << "NO" << endl;
		}
	}
	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;
	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 1, n+1) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec));
    	fore(i, 0, n/2){
    		if(!ans and n-(i*2) <= vec[n-1-i].fst-vec[i].fst){
    			cout<<"YES\n"<<min(vec[0].snd,vec[n-1].snd)<<" "<<max(vec[0].snd,vec[n-1].snd)<<"\n";
    			ans = 1;
    		}
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;
	ll res = 0;
	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 1, n+1) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec),sortinrev);

    	ll asd = 0;
    	ll qwe = n-1;
    	fore(i, 0, n){
    		if(qwe<=asd) break;
    		if(abs(vec[asd].snd - vec[qwe].snd) < vec[asd].fst - vec[qwe].fst){
    			cout<<"YES\n"<<min(vec[asd].snd,vec[qwe].snd)<<" "<<max(vec[asd].snd,vec[qwe].snd)<<"\n";
    			ans = 1; break;
    		}
    		if(vec[asd].fst - vec[asd+1].fst < vec[qwe].fst - vec[qwe-1].fst){
    			qwe--;
    		}
    		else if(vec[qwe].fst - vec[qwe-1].fst < vec[asd].fst - vec[asd+1].fst){
    			asd++;
    		}
    		else{
    			asd++;qwe--;
    		}
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;
	ll res = 0;
	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 1, n+1) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec),sortinrev);

    	ll asd = 0;
    	ll qwe = n-1;
    	fore(i, 0, n){
    		if(qwe<=asd) break;
    		if(abs(vec[asd].snd - vec[qwe].snd) < vec[asd].fst - vec[qwe].fst){
    			cout<<"YES\n"<<vec[asd].snd<<" "<<vec[qwe].snd<<"\n";
    			ans = 1; break;
    		}
    		if(vec[asd].fst - vec[asd+1].fst < vec[qwe].fst - vec[qwe-1].fst){
    			asd++;
    		}
    		else if(vec[qwe].fst - vec[qwe-1].fst < vec[asd].fst - vec[asd+1].fst){
    			qwe--;
    		}
    		else{
    			asd++;qwe--;
    		}
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;

	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 0, n) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec));
		if(n< vec[n-1].fst-vec[0].fst){
			cout<<"YES\n"<<min(vec[0].snd,vec[n-1].snd)+1<<" "<<max(vec[0].snd,vec[n-1].snd)+1<<"\n";
		}
		else{
			cout<<"NO\n";
		}
	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;

	while(t--){
		cin>>n;
		ll vec[n];
		fore(i, 0, n) cin>>vec[i];
		sort(vec,vec+n,greater<int>());
    	fore(i, 1, n-1){
    		 if(!ans and 1<abs(vec[i]-vec[i-1])){
				cout<<"YES\n";
				cout<<i-1<<" "<<i<<"\n";
				ans = 1;
			}else if(!ans and 1<abs(vec[i]-vec[i+1])){
		 		cout<<"YES\n";
		 		cout<<i<<" "<<i+1<<"\n";
		 		ans = 1;
		 	}
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(long long i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

    bool cmp(pair<int, int> p1, pair<int, int> p2) {
        if(p1.first > p2.first)
            return true;
        if(p1.first < p2.first)
            return false;
        return p1.second <= p2.second;
    }

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;
	ll res = 0;
	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 1, n+1) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec),cmp);
    	ll asd = 0;

    	fore(i, 0, n){
    		fore(j,1,n-i){ //1     5        8 8 8 8 5
    			if(0< vec[i+j].snd - vec[i].snd and vec[j+i].snd - vec[i].snd < vec[i].fst - vec[i + j].fst){
    				cout<<"YES\n"<<vec[i].snd<<" "<<vec[j+i].snd<<"\n";
    				ans =1;break;
    			}
    		}
    		if(ans) break;
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;

	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 1, n+1) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec));
		if(n<= vec[n-1].fst-vec[0].fst){
			cout<<"YES\n"<<min(vec[0].snd,vec[n-1].snd)<<" "<<max(vec[0].snd,vec[n-1].snd)<<"\n";
		}
		else{
			cout<<"NO\n";
		}
	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;

	while(t--){
		cin>>n;
		ll vec[n];
		fore(i, 0, n) cin>>vec[i];
    	fore(i, 1, n-1){
    		 if(!ans and 1<abs(vec[i]-vec[i-1])){
				cout<<"YES\n";
				cout<<i<<" "<<i+1<<"\n";
				ans = 1;
			}else if(!ans and 1<abs(vec[i]-vec[i+1])){
		 		cout<<"YES\n";
		 		cout<<i+1<<" "<<i+2<<"\n";
		 		ans = 1;
		 	}
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;

	while(t--){
		cin>>n;
		ll vec[n];
		fore(i, 0, n) cin>>vec[i];
		sort(vec,vec+n,greater<int>());
    	fore(i, 1, n-1){
    		 if(!ans and 1<abs(vec[i]-vec[i-1])){
				cout<<"YES\n";
				cout<<i<<" "<<i+1<<"\n";
				ans = 1;
			}else if(!ans and 1<abs(vec[i]-vec[i+1])){
		 		cout<<"YES\n";
		 		cout<<i+1<<" "<<i+2<<"\n";
		 		ans = 1;
		 	}
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(long long i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

    bool cmp(pair<int, int> p1, pair<int, int> p2) {
        if(p1.first > p2.first)
            return true;
        if(p1.first < p2.first)
            return false;
        return p1.second <= p2.second;
    }

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;
	ll res = 0;
	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 1, n+1) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec),cmp);
    	ll asd = 0;

    	fore(i, 0, n-1){
    		fore(j,1,n-i){ //1     5       5 5 8 8 8
    			if(abs(vec[j+i].snd - vec[i].snd) < abs(vec[i].fst - vec[i + j].fst)){
    				cout<<"YES\n"<<min(vec[i].snd,vec[j+i].snd)<<" "<<max(vec[i].snd,vec[j+i].snd)<<"\n";
    				ans =1;break;
    			}
    		}
    		if(ans) break;
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(long long i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;

	while(t--){
		cin>>n;
		ll vec[n];
		fore(i, 0, n) cin>>vec[i];
    	fore(i, 0, n-1){
			if(!ans and 1<abs(vec[i]-vec[i+1])){
		 		cout<<"YES\n";
		 		cout<<i+1<<" "<<i+2<<"\n";
		 		ans = 1;
		 	}
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;
	ll res = 0;
	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 1, n+1) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec),sortinrev);

    	ll asd = 0;
    	ll qwe = n-1;
    	fore(i, 0, n){
    		if(qwe<=asd) break;
    		if(abs(vec[asd].snd - vec[qwe].snd) < vec[asd].fst - vec[qwe].fst){
    			cout<<"YES\n"<<min(vec[asd].snd,vec[qwe].snd)<<" "<<max(vec[asd].snd,vec[qwe].snd)<<"\n";
    			ans = 1; break;
    		}
    		if(vec[asd].fst - vec[asd+1].fst < vec[qwe].fst - vec[qwe-1].fst){
    			asd++;
    		}
    		else if(vec[qwe].fst - vec[qwe-1].fst < vec[asd].fst - vec[asd+1].fst){
    			qwe--;
    		}
    		else{
    			asd++;qwe--;
    		}
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;

	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 0, n) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec));
		if(n< vec[n-1].fst-vec[0].fst){
			cout<<"YES\n"<<min(vec[0].snd,vec[n-1].snd)<<" "<<max(vec[0].snd,vec[n-1].snd)+1<<"\n";
		}
		else{
			cout<<"NO\n";
		}
	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(long long i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

    bool cmp(pair<int, int> p1, pair<int, int> p2) {
        if(p1.first > p2.first)
            return true;
        if(p1.first < p2.first)
            return false;
        return p1.second <= p2.second;
    }

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;
	ll res = 0;
	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 1, n+1) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec),cmp);
    	ll asd = 0;

    	fore(i, 0, n-1){
    		fore(j,1,n-i){ //1     5       5 5 8 8 8
    			if(abs(vec[j+i].snd - vec[i].snd) < abs(vec[i].fst - vec[i + j].fst)){
    				cout<<"YES\n"<<vec[i].snd<<" "<<vec[j+i].snd<<"\n";
    				ans =1;break;
    			}
    		}
    		if(ans) break;
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;

	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 1, n+1) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec));
		if(n< vec[n-1].fst-vec[0].fst){
			cout<<"YES\n"<<min(vec[0].snd,vec[n-1].snd)<<" "<<max(vec[0].snd,vec[n-1].snd)<<"\n";
		}
		else{
			cout<<"NO\n";
		}
	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

int main()
{
	DSYNC;
	ll t, n, k1, k2;
	cin>>t;
	ll ans =0;
	ll par = 0;
	while(t--){
		cin>>n>>k1>>k2;
		int arr1[n];
		int arr2[n];
		fore(i, 0, k1) cin>>arr1[i];
		fore(i, 0, k2) cin>>arr2[i];
		sort(arr1, arr1+k1,greater<int>());
		sort(arr2, arr2+k2,greater<int>());
		fore(i, 0, min(k1,k2)){
			if(arr2[i]<arr1[i]){
				ans++;
			}
			else par++;
		}
		if(ans>par) cout<<"YES\n";
		else cout<<"NO\n";
	}

	return 0;
}


#include <bits/stdc++.h>
#define fst first
#define snd second
#define mset(a,b) memset(a,b,sizeof(a));
#define fore(i,o,p) for(int i=o,ggd=p;i<ggd;i++)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(),a.end()
#define DSYNC ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define watch(x) cerr << #x << “ = ” << (x) << endl

using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int INF = 0x3f3f3f3f;

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}

int main()
{
	DSYNC;
	ll t, n, x;
	cin>>t;
	ll ans = 0;
	ll res = 0;
	while(t--){
		cin>>n;
		vector<ii> vec;
		fore(i, 1, n+1) {cin>>x;vec.pb({x,i});}
		sort(ALL(vec),sortinrev);

    	ll asd = 0;
    	ll qwe = n-1;
    	fore(i, 0, n){
    		if(qwe<=asd) break;
    		if(0<vec[qwe].snd - vec[asd].snd and vec[qwe].snd - vec[asd].snd < vec[asd].fst - vec[qwe].fst){
    			cout<<"YES\n"<<min(vec[asd].snd,vec[qwe].snd)<<" "<<max(vec[asd].snd,vec[qwe].snd)<<"\n";
    			ans = 1; break;
    		}
    		if(vec[asd].fst - vec[asd+1].fst < vec[qwe].fst - vec[qwe-1].fst){
    			qwe--;
    		}
    		else if(vec[qwe].fst - vec[qwe-1].fst < vec[asd].fst - vec[asd+1].fst){
    			asd++;
    		}
    		else{
    			asd++;qwe--;
    		}
    	}
		if(!ans){
			cout<<"NO\n";
		}
		ans = 0;

	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

#define ll           long long
#define pii          pair<ll,ll>
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAX = 2e5+10;

int a[MAX], mxx[MAX];

struct Tree
{
    int mx,mn;
    Tree() {}
    Tree(int _mx,int _mn)
    {
        mx = _mx;
        mn = _mn;
    }

} tree[4*MAX];

void build(int pos,int l,int r)
{
    if(l == r)
    {
        tree[pos].mx = tree[pos].mn = a[l];
        return;
    }

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    build(left,l,mid);
    build(right,mid+1,r);

    tree[pos].mx = max(tree[left].mx,tree[right].mx);
    tree[pos].mn = min(tree[left].mn,tree[right].mn);
}

Tree query(int pos,int l,int r,int L,int R)
{
    if(l > R || r < L)
        return Tree(0,INT_MAX);
    else if(l >= L && r <= R)
        return tree[pos];

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    Tree x = query(left,l,mid,L,R);
    Tree y = query(right,mid+1,r,L,R);

    x.mx = max(x.mx,y.mx);
    x.mn = min(x.mn,y.mn);

    return x;
}

int main()
{
#ifdef Aaman007
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
#endif // Aaman007

    FastRead

    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i=1; i<=n; i++)
            cin >> a[i];

        build(1,1,n);

        int mx = 0, mn = 2e9, l, r;
        bool flag = 0;

        for(int i=1; i<=n; i++)
        {
            l = (1,i-a[i]+1) , r = i;

            Tree x = query(1,1,n,l,r);

            int l1 = l;
            if(x.mx-x.mn < r-l+1)
                l1 = i-(x.mx-x.mn);

            l = i;
            while(abs(a[r]-a[l]) < r-l+1 && l >= l1)
                l--;

            if(l < l1)
            {
                r = min(n,i+a[i]-1) , l = i;

                x = query(1,1,n,l,r);
                l1 = r;

                if(x.mx-x.mn < r-l+1)
                    l1 = i+(x.mx-x.mn);

                r = i;
                while(abs(a[r]-a[l]) < r-l+1 && r <= l1)
                    r++;;
                if(r <= l1)
                {
                    flag = 1;
                    break;
                }
            }
            else
            {
                flag = 1;
                break;
            }
        }

        if(flag)
            cout << "YES\n" << l << " " << r << endl;
        else
            cout << "NO\n";
    }
}
/***
1
5
9 10 10 12 11
****/


#include<bits/stdc++.h>
using namespace std;

#define ll           long long
#define pii          pair<ll,ll>
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAX = 2e5+10;

int a[MAX], mxx[MAX];

struct Tree
{
    int mx,mn;
    Tree() {}
    Tree(int _mx,int _mn)
    {
        mx = _mx;
        mn = _mn;
    }

} tree[4*MAX];

void build(int pos,int l,int r)
{
    if(l == r)
    {
        tree[pos].mx = tree[pos].mn = a[l];
        return;
    }

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    build(left,l,mid);
    build(right,mid+1,r);

    tree[pos].mx = max(tree[left].mx,tree[right].mx);
    tree[pos].mn = min(tree[left].mn,tree[right].mn);
}

Tree query(int pos,int l,int r,int L,int R)
{
    if(l > R || r < L)
        return Tree(0,INT_MAX);
    else if(l >= L && r <= R)
        return tree[pos];

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    Tree x = query(left,l,mid,L,R);
    Tree y = query(right,mid+1,r,L,R);

    x.mx = max(x.mx,y.mx);
    x.mn = min(x.mn,y.mn);

    return x;
}

int main()
{
#ifdef Aaman007
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
#endif // Aaman007

    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i=1; i<=n; i++)
            cin >> a[i];

        build(1,1,n);

        int mx = 0, mn = 2e9, l, r;
        bool flag = 0;

        for(int i=1; i<=n; i++)
        {
            l = i, r = min(n,i+a[i]-1);
            Tree x = query(1,1,n,l,r);

            if(x.mx-x.mn >= r-l+1)
            {
                flag = 1;
                break;
            }
        }

        if(flag)
            cout << "YES\n" << l << " " << r << endl;
        else
            cout << "NO\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ll           long long
#define pii          pair<ll,ll>
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAX = 2e5+10;

int a[MAX], mxx[MAX];

struct Tree
{
    int mx,mn;
    Tree() {}
    Tree(int _mx,int _mn)
    {
        mx = _mx;
        mn = _mn;
    }

} tree[4*MAX];

void build(int pos,int l,int r)
{
    if(l == r)
    {
        tree[pos].mx = tree[pos].mn = a[l];
        return;
    }

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    build(left,l,mid);
    build(right,mid+1,r);

    tree[pos].mx = max(tree[left].mx,tree[right].mx);
    tree[pos].mn = min(tree[left].mn,tree[right].mn);
}

Tree query(int pos,int l,int r,int L,int R)
{
    if(l > R || r < L)
        return Tree(0,INT_MAX);
    else if(l >= L && r <= R)
        return tree[pos];

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    Tree x = query(left,l,mid,L,R);
    Tree y = query(right,mid+1,r,L,R);

    x.mx = max(x.mx,y.mx);
    x.mn = min(x.mn,y.mn);

    return x;
}

int main()
{
#ifdef Aaman007
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
#endif // Aaman007

    FastRead

    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i=1; i<=n; i++)
            cin >> a[i];

        build(1,1,n);

        int mx = 0, mn = 2e9, l, r;
        bool flag = 0;

        for(int i=1; i<=n; i++)
        {
            l = max(1,i-a[i]+1) , r = i;

            Tree x = query(1,1,n,l,r);

            int l1 = l;
            if(x.mx-x.mn < r-l+1)
                l1 = i-(x.mx-x.mn);

            l = i;
            while(abs(a[r]-a[l]) < r-l+1 && l >= l1)
                l--;

            if(l < l1)
            {
                r = min(n,i+a[i]-1) , l = i;

                x = query(1,1,n,l,r);
                l1 = r;

                if(x.mx-x.mn < r-l+1)
                    l1 = i+(x.mx-x.mn);

                r = i;
                while(abs(a[r]-a[l]) < r-l+1 && r <= l1)
                    r++;;
                if(r <= l1)
                {
                    flag = 1;
                    break;
                }
            }
            else
            {
                flag = 1;
                break;
            }
        }

        if(flag)
            cout << "YES\n" << l << " " << r << endl;
        else
            cout << "NO\n";
    }
}
/***
1
5
9 10 10 12 11
****/


#include<bits/stdc++.h>
using namespace std;

#define ll           long long
#define pii          pair<ll,ll>
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAX = 2e5+10;

int a[MAX], mxx[MAX];

struct Tree
{
    int mx,mn;
    Tree() {}
    Tree(int _mx,int _mn)
    {
        mx = _mx;
        mn = _mn;
    }

} tree[4*MAX];

void build(int pos,int l,int r)
{
    if(l == r)
    {
        tree[pos].mx = tree[pos].mn = a[l];
        return;
    }

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    build(left,l,mid);
    build(right,mid+1,r);

    tree[pos].mx = max(tree[left].mx,tree[right].mx);
    tree[pos].mn = min(tree[left].mn,tree[right].mn);
}

Tree query(int pos,int l,int r,int L,int R)
{
    if(l > R || r < L)
        return Tree(0,INT_MAX);
    else if(l >= L && r <= R)
        return tree[pos];

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    Tree x = query(left,l,mid,L,R);
    Tree y = query(right,mid+1,r,L,R);

    x.mx = max(x.mx,y.mx);
    x.mn = min(x.mn,y.mn);

    return x;
}

int main()
{
#ifdef Aaman007
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
#endif // Aaman007

    FastRead

    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i=1; i<=n; i++)
            cin >> a[i];

        build(1,1,n);

        int mx = 0, mn = 2e9, l, r;
        bool flag = 0;

        for(int i=2; i<=n; i++)
        {
            if(abs(a[i]-a[i-1]) > 1)
            {
                flag = 1 , l = i-1 , r = i;
                break;
            }
        }

        if(flag)
            cout << "YES\n" << l << " " << r << endl;
        else
            cout << "NO\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ll           long long
#define pii          pair<ll,ll>
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAX = 2e5+10;

int a[MAX], mxx[MAX];

struct Tree
{
    int mx,mn;
    Tree() {}
    Tree(int _mx,int _mn)
    {
        mx = _mx;
        mn = _mn;
    }

} tree[4*MAX];

void build(int pos,int l,int r)
{
    if(l == r)
    {
        tree[pos].mx = tree[pos].mn = a[l];
        return;
    }

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    build(left,l,mid);
    build(right,mid+1,r);

    tree[pos].mx = max(tree[left].mx,tree[right].mx);
    tree[pos].mn = min(tree[left].mn,tree[right].mn);
}

Tree query(int pos,int l,int r,int L,int R)
{
    if(l > R || r < L)
        return Tree(0,INT_MAX);
    else if(l >= L && r <= R)
        return tree[pos];

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    Tree x = query(left,l,mid,L,R);
    Tree y = query(right,mid+1,r,L,R);

    x.mx = max(x.mx,y.mx);
    x.mn = min(x.mn,y.mn);

    return x;
}

int main()
{
#ifdef Aaman007
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
#endif // Aaman007

    FastRead

    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i=1; i<=n; i++)
            cin >> a[i];

        build(1,1,n);

        int mx = 0, mn = 2e9, l, r;
        bool flag = 0;

        for(int i=2; i<=n; i++)
        {
            if(abs(a[i]-a[i-1]) > 1)
            {
                flag = 1;
                break;
            }
        }

        if(flag)
            cout << "YES\n" << l << " " << r << endl;
        else
            cout << "NO\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ll           long long
#define pii          pair<ll,ll>
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAX = 2e5+10;

int a[MAX];

struct Tree
{
    int mx,mn;
    Tree(){}
    Tree(int _mx,int _mn)
    {
        mx = _mx;
        mn = _mn;
    }

}tree[4*MAX];

void build(int pos,int l,int r)
{
    if(l == r)
    {
        tree[pos].mx = tree[pos].mn = a[l];
        return;
    }

    int mid = (l+r)/2 , left = 2*pos , right = 2*pos+1;

    build(left,l,mid);
    build(right,mid+1,r);

    tree[pos].mx = max(tree[left].mx,tree[right].mx);
    tree[pos].mn = min(tree[left].mn,tree[right].mn);
}

Tree query(int pos,int l,int r,int L,int R)
{
    if(l > R || r < L)
        return Tree(0,INT_MAX);
    else if(l >= L && r <= R)
        return tree[pos];

    int mid = (l+r)/2 , left = 2*pos , right = 2*pos+1;

    Tree x = query(left,l,mid,L,R);
    Tree y = query(right,mid+1,r,L,R);

    x.mx = max(x.mx,y.mx);
    x.mn = min(x.mn,y.mn);

    return x;
}

int main()
{
#ifdef Aaman007
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
#endif // Aaman007

    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i=1;i<=n;i++)
            cin >> a[i];

        int mx = 0 , mn = 2e9 , l , r;
        bool flag = 0;

        for(int i=1;i<=n;i++)
        {
            if(a[i] < mn)
            {
                mn = a[i];
                l = i;
            }

            if(a[i]-mn >= i-l+1)
            {
                r = i;
                flag = 1;
                break;
            }
        }

        if(flag)
            cout << "YES\n" << l << " " << r << endl;
        else
            cout << "NO\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ll           long long
#define pii          pair<ll,ll>
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAX = 2e5+10;

int a[MAX], mxx[MAX];

struct Tree
{
    int mx,mn;
    Tree() {}
    Tree(int _mx,int _mn)
    {
        mx = _mx;
        mn = _mn;
    }

} tree[4*MAX];

void build(int pos,int l,int r)
{
    if(l == r)
    {
        tree[pos].mx = tree[pos].mn = a[l];
        return;
    }

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    build(left,l,mid);
    build(right,mid+1,r);

    tree[pos].mx = max(tree[left].mx,tree[right].mx);
    tree[pos].mn = min(tree[left].mn,tree[right].mn);
}

Tree query(int pos,int l,int r,int L,int R)
{
    if(l > R || r < L)
        return Tree(0,INT_MAX);
    else if(l >= L && r <= R)
        return tree[pos];

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    Tree x = query(left,l,mid,L,R);
    Tree y = query(right,mid+1,r,L,R);

    x.mx = max(x.mx,y.mx);
    x.mn = min(x.mn,y.mn);

    return x;
}

int main()
{
#ifdef Aaman007
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
#endif // Aaman007

    FastRead

    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i=1; i<=n; i++)
            cin >> a[i];

        int mx = 0, mn = 2e9, l, r;
        bool flag = 0;

        for(int i=1; i<=n; i++)
        {
            l = i , r = i;

            while(abs(a[r]-a[l]) < r-l+1 && l > 0)
                l--;

            if(l == 0)
            {
                r = i , l = i;

                while(abs(a[r]-a[l]) < r-l+1 && r <= n)
                    r++;;
                if(r <= n)
                {
                    flag = 1;
                    break;
                }
            }
            else
            {
                flag = 1;
                break;
            }
        }

        if(flag)
            cout << "YES\n" << l << " " << r << endl;
        else
            cout << "NO\n";
    }
}
/***
1
5
9 10 10 12 11
****/


#include<bits/stdc++.h>
using namespace std;

#define ll           long long
#define pii          pair<ll,ll>
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAX = 2e5+10;

int a[MAX], mxx[MAX];

struct Tree
{
    int mx,mn;
    Tree() {}
    Tree(int _mx,int _mn)
    {
        mx = _mx;
        mn = _mn;
    }

} tree[4*MAX];

void build(int pos,int l,int r)
{
    if(l == r)
    {
        tree[pos].mx = tree[pos].mn = a[l];
        return;
    }

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    build(left,l,mid);
    build(right,mid+1,r);

    tree[pos].mx = max(tree[left].mx,tree[right].mx);
    tree[pos].mn = min(tree[left].mn,tree[right].mn);
}

Tree query(int pos,int l,int r,int L,int R)
{
    if(l > R || r < L)
        return Tree(0,INT_MAX);
    else if(l >= L && r <= R)
        return tree[pos];

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    Tree x = query(left,l,mid,L,R);
    Tree y = query(right,mid+1,r,L,R);

    x.mx = max(x.mx,y.mx);
    x.mn = min(x.mn,y.mn);

    return x;
}

int main()
{
#ifdef Aaman007
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
#endif // Aaman007

    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i=1; i<=n; i++)
            cin >> a[i];

        build(1,1,n);

        int mx = 0, mn = 2e9, l, r;
        bool flag = 0;

        for(int i=1; i<=n; i++)
        {
            l = i, r = min(n,i+a[i]-1);
            Tree x = query(1,1,n,l,r);

            if(x.mx-x.mn >= r-l+1)
            {
                flag = 1;
                break;
            }

            l = i , r = max(1,i-a[i]+1);
            x = query(1,1,n,l,r);

            if(x.mx-x.mn >= r-l+1)
            {
                flag = 1;
                break;
            }
        }

        if(flag)
            cout << "YES\n" << l << " " << r << endl;
        else
            cout << "NO\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ll           long long
#define pii          pair<ll,ll>
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAX = 2e5+10;

int a[MAX];

struct Tree
{
    int mx,mn;
    Tree() {}
    Tree(int _mx,int _mn)
    {
        mx = _mx;
        mn = _mn;
    }

} tree[4*MAX];

void build(int pos,int l,int r)
{
    if(l == r)
    {
        tree[pos].mx = tree[pos].mn = a[l];
        return;
    }

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    build(left,l,mid);
    build(right,mid+1,r);

    tree[pos].mx = max(tree[left].mx,tree[right].mx);
    tree[pos].mn = min(tree[left].mn,tree[right].mn);
}

Tree query(int pos,int l,int r,int L,int R)
{
    if(l > R || r < L)
        return Tree(0,INT_MAX);
    else if(l >= L && r <= R)
        return tree[pos];

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    Tree x = query(left,l,mid,L,R);
    Tree y = query(right,mid+1,r,L,R);

    x.mx = max(x.mx,y.mx);
    x.mn = min(x.mn,y.mn);

    return x;
}

int main()
{
#ifdef Aaman007
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
#endif // Aaman007

    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i=1; i<=n; i++)
            cin >> a[i];

        int mx = 0, mn = 2e9, l, r;
        bool flag = 0;

        for(int i=1; i<=n; i++)
        {
            if(a[i] < mn)
            {
                mn = a[i];
                l = i;
            }

            if(a[i]-mn >= i-l+1)
            {
                r = i;
                flag = 1;
                break;
            }
        }
        if(!flag)
        {
            for(int i=1; i<=n; i++)
            {
                if(a[i] > mx)
                {
                    mx = a[i];
                    l = i;
                }

                if(mx-a[i] >= i-l+1)
                {
                    r = i;
                    flag = 1;
                    break;
                }
            }
        }

        if(flag)
            cout << "YES\n" << l << " " << r << endl;
        else
            cout << "NO\n";
    }
}


#include<bits/stdc++.h>
using namespace std;

#define ll           long long
#define pii          pair<ll,ll>
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAX = 2e5+10;

int a[MAX], mxx[MAX];

struct Tree
{
    int mx,mn;
    Tree() {}
    Tree(int _mx,int _mn)
    {
        mx = _mx;
        mn = _mn;
    }

} tree[4*MAX];

void build(int pos,int l,int r)
{
    if(l == r)
    {
        tree[pos].mx = tree[pos].mn = a[l];
        return;
    }

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    build(left,l,mid);
    build(right,mid+1,r);

    tree[pos].mx = max(tree[left].mx,tree[right].mx);
    tree[pos].mn = min(tree[left].mn,tree[right].mn);
}

Tree query(int pos,int l,int r,int L,int R)
{
    if(l > R || r < L)
        return Tree(0,INT_MAX);
    else if(l >= L && r <= R)
        return tree[pos];

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    Tree x = query(left,l,mid,L,R);
    Tree y = query(right,mid+1,r,L,R);

    x.mx = max(x.mx,y.mx);
    x.mn = min(x.mn,y.mn);

    return x;
}

int main()
{
#ifdef Aaman007
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
#endif // Aaman007

    FastRead

    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i=1; i<=n; i++)
            cin >> a[i];

        build(1,1,n);

        int mx = 0, mn = 2e9, l, r;
        bool flag = 0;

        for(int i=1; i<=n; i++)
        {
            l = max(1,i-a[i]+1) , r = i;

            Tree x = query(1,1,n,l,r);

            int l1 = l;

            l = i;
            while(abs(a[r]-a[l]) < r-l+1 && l >= l1)
                l--;

            if(l < l1)
            {
                r = min(n,i+a[i]-1) , l = i;

                x = query(1,1,n,l,r);
                l1 = r;
                r = i;
                while(abs(a[r]-a[l]) < r-l+1 && r <= l1)
                    r++;;
                if(r <= l1)
                {
                    flag = 1;
                    break;
                }
            }
            else
            {
                flag = 1;
                break;
            }
        }

        if(flag)
            cout << "YES\n" << l << " " << r << endl;
        else
            cout << "NO\n";
    }
}
/***
1
5
9 10 10 12 11
****/


#include<bits/stdc++.h>
using namespace std;

#define ll           long long
#define pii          pair<ll,ll>
#define bug(a)       cerr << #a << " : " << a << endl;
#define FastRead     ios_base::sync_with_stdio(false);cin.tie(NULL);

const int MAX = 2e5+10;

int a[MAX], mxx[MAX];

struct Tree
{
    int mx,mn;
    Tree() {}
    Tree(int _mx,int _mn)
    {
        mx = _mx;
        mn = _mn;
    }

} tree[4*MAX];

void build(int pos,int l,int r)
{
    if(l == r)
    {
        tree[pos].mx = tree[pos].mn = a[l];
        return;
    }

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    build(left,l,mid);
    build(right,mid+1,r);

    tree[pos].mx = max(tree[left].mx,tree[right].mx);
    tree[pos].mn = min(tree[left].mn,tree[right].mn);
}

Tree query(int pos,int l,int r,int L,int R)
{
    if(l > R || r < L)
        return Tree(0,INT_MAX);
    else if(l >= L && r <= R)
        return tree[pos];

    int mid = (l+r)/2, left = 2*pos, right = 2*pos+1;

    Tree x = query(left,l,mid,L,R);
    Tree y = query(right,mid+1,r,L,R);

    x.mx = max(x.mx,y.mx);
    x.mn = min(x.mn,y.mn);

    return x;
}

int main()
{
#ifdef Aaman007
    freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
#endif // Aaman007

    FastRead

    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i=1; i<=n; i++)
            cin >> a[i];

        build(1,1,n);

        int mx = 0, mn = 2e9, l, r;
        bool flag = 0;

        for(int i=1; i<=n; i++)
        {
            l = (1,i-a[i]+1) , r = i;

            Tree x = query(1,1,n,l,r);

            int l1 = l;

            l = i;
            while(abs(a[r]-a[l]) < r-l+1 && l >= l1)
                l--;

            if(l < l1)
            {
                r = min(n,i+a[i]-1) , l = i;

                x = query(1,1,n,l,r);
                l1 = r;
                r = i;
                while(abs(a[r]-a[l]) < r-l+1 && r <= l1)
                    r++;;
                if(r <= l1)
                {
                    flag = 1;
                    break;
                }
            }
            else
            {
                flag = 1;
                break;
            }
        }

        if(flag)
            cout << "YES\n" << l << " " << r << endl;
        else
            cout << "NO\n";
    }
}
/***
1
5
9 10 10 12 11
****/


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define re return
int main() {
	ll t;
	ios_base::sync_with_stdio(0);
	cin >> t;
	for (ll i = 1; i <= t; ++i) {
		ll n;
		cin >> n;
		ll mx = 0;
		ll a[n + 10];
		for (ll j = 1; j <= n; ++j) {
			cin >> a[j];
		}
		for (ll j = 2; j <= n; ++j) {
			if (abs(a[j] - a[1]) >= n) {
				cout << "YES\n" << 1 << " " << j << "\n";
				mx++;
				break;
			}
		}
		if (mx == 0)
			cout << "NO\n";
	}
	re 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define re return
int main() {
	ll t;
	ios_base::sync_with_stdio(0);
	cin >> t;
	for (ll i = 1; i <= t; ++i) {
		ll n;
		cin >> n;
		ll mx = 0;
		ll mn = 1e7;
		for (ll j = 1; j <= n; ++j) {
			ll a;
			cin >> a;
			mx = max(mx, a);
			mn = min(mn, a);
		}
		if (mx - mn >= n) {
			cout << "YES\n";
			cout << mn << " " << mx << "\n";
		}
		else
			cout << "NO\n";
	}
	re 0;
}


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n;
    		cin >> n;
    		ll a;
    		pair <ll, ll> p[n + 10];
    		for (ll i = 1; i <= n; ++i) {
    			cin >> a;
    			p[i].fi = a;
    			p[i].se = i;
    		}
    		sort(p + 1, p + 1 + n);
    		ll k = 0;
    		for (ll j = n; j >= 1; --j)
	    		for (ll i = 1; i < j; ++i) {
	    			if (p[j].fi - p[i].fi >= abs(p[j].se - p[i].se) + 1) {
	    				cout << "YES\n" << min(p[i].se, p[j].se) << " " << max(p[i].se, p[j].se) << "\n";
	    				k++;
	    				break;
	    			}
	    		}
    		if (k == 0)
    			cout << "NO\n";
    	}
    	re 0;
    }


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n, k = 0;
    		cin >> n;
    		ll a[n + 10];
    		cin >> a[1];
    		for (int i = 2; i <= n; ++i) {
    			cin >> a[i];
    			if (abs(a[i] - a[i - 1]) >= 2) {
    				if (k == 0) {
    					cout << "YES\n"<< i - 1 << " " << i << "\n";
    					k++;
    				}
    			}
    		}
    		if (k == 0)
    			cout << "NO\n";
    	}
    	re 0;
    }


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define re return
int main() {
	ll t;
	ios_base::sync_with_stdio(0);
	cin >> t;
	for (ll tttt = 1; tttt <= t; ++tttt) {
		ll n, k = 0;
		cin >> n;
		ll a[n + 10];
		for (ll i = 1; i <= n; ++i)
			cin >> a[i];
		ll l = 1, r = n;
		while(l < r) {
			ll mx = 0;
			ll mn = 1e10;
			for (ll i = l; i <= r; ++i) {
				mx = max(a[i], mx);
				mn = min(a[i], mn);
			}
			if (mx - mn >= (r - l) + 1) {
				cout << "YES\n" << l << " " << r << "\n";
				break;
			}
			l++;
			r--;
		}
		if (l < r)
			cout << "NO\n";
	}
	re 0;
}


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n;
    		cin >> n;
    		ll a;
    		pair <ll, ll> p[n + 10];
    		for (ll i = 1; i <= n; ++i) {
    			cin >> a;
    			p[i].fi = a;
    			p[i].se = i;
    		}
    		sort(p + 1, p + 1 + n);
    		ll k = 0;
    		for (ll i = 1; i < n; ++i) {
    			if (p[n].fi - p[i].fi >= abs(p[n].se - p[i].se) + 1) {
    				cout << "YES\n" << min(p[i].se, p[n].se) << " " << max(p[i].se, p[n].se) << "\n";
    				k++;
    				break;
    			}
    		}
    		if (k == 0)
    			cout << "NO\n";
    	}
    	re 0;
    }


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n, k = 0;
    		cin >> n;
    		ll a[n + 10];
    		ll mx = 0, mn = 1e10, l = 1, r = 1;
    		for (ll i = 1; i <= n; ++i) {
    			cin >> a[i];
    		}
    		sort(a + 1, a + 1 + n);
 			for (ll i = 1; i <= n; ++i) {
    			if (mx < a[i]) {
    				mx = a[i];
    				r = i;
    			}
    			if (mn > a[i]) {
    				mn = a[i];
    				l = i;
    			}
 			}
    		if (mx - mn >= abs(r - l) + 1)
    			cout << "YES\n" << min(l, r) << " " << max(l, r) << "\n";
    		else
    			cout << "NO\n";
    	}
    	re 0;
    }


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define re return
int main() {
	ll t;
	ios_base::sync_with_stdio(0);
	cin >> t;
	for (ll tttt = 1; tttt <= t; ++tttt) {
		ll n;
		cin >> n;
		ll mx = 0;
		ll a[n + 10];
		for (ll j = 1; j <= n; ++j) {
			cin >> a[j];
		}
		for (ll i = 1; i <= n; ++i) {
			if (mx == 1)
				break;
			for (ll j = i + 1; j <= n; ++j) {
				if (abs(a[j] - a[i]) >= n) {
					cout << "YES\n" << i << " " << j << "\n";
					mx++;
					break;
				}
			}
		}
		if (mx == 0)
			cout << "NO\n";
	}
	re 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define re return
int main() {
	ll t;
	ios_base::sync_with_stdio(0);
	cin >> t;
	for (ll i = 1; i <= t; ++i) {
		ll n;
		ll mx = 0;
		ll mn = 1e7;
		for (ll j = 1; j <= n; ++j) {
			ll a;
			cin >> a;
			mx = max(mx, a);
			mn = min(mn, a);
		}
		if (mx - mn >= n) {
			cout << "YES\n";
			cout << mn << " " << mx << "\n";
		}
		else
			cout << "NO\n";
	}
	re 0;
}


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n, k = 0;
    		cin >> n;
    		ll a[n + 10];
    		ll mx = 0, mn = 1e10, l = 1, r = 1;
    		for (ll i = 1; i <= n; ++i) {
    			cin >> a[i];
    			if (mx < a[i]) {
    				mx = a[i];
    				r = i;
    			}
    			if (mn > a[i]) {
    				mn = a[i];
    				l = i;
    			}
    		}
    		if (mx - mn >= abs(r - l) + 1)
    			cout << "YES\n" << l << " " << r << "\n";
    		else
    			cout << "NO\n";
    	}
    	re 0;
    }


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n, k = 0;
    		cin >> n;
    		ll a[n + 10];
    		ll mx = 0, mn = 1e10, l = 1, r = 1;
    		for (ll i = 1; i <= n; ++i) {
    			cin >> a[i];
    			if (mx < a[i]) {
    				mx = a[i];
    				r = i;
    			}
    			if (mn > a[i]) {
    				mn = a[i];
    				l = i;
    			}
    		}
    		if (mx - mn >= (r - l) + 1)
    			cout << "YES\n" << l << " " << r << "\n";
    		else
    			cout << "NO\n";
    	}
    	re 0;
    }


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define re return
int main() {
	ll t;
	ios_base::sync_with_stdio(0);
	cin >> t;
	for (ll tttt = 1; tttt <= t; ++tttt) {
		ll n, k = 0;
		cin >> n;
		ll a[n + 10];
		for (ll i = 1; i <= n; ++i)
			cin >> a[i];
		ll l = 1, r = n;
		while(l < r) {
			if (a[r] - a[l] >= (r - l) + 1) {
				cout << "YES\n" << l << " " << r << "\n";
				break;
			}
			l++;
			r--;
		}
		if (l < r)
			cout << "NO\n";
	}
	re 0;
}


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n, k = 0;
    		cin >> n;
    		ll a;
    		pair <ll, ll> p[n + 10];
    		for (ll i = 1; i <= n; ++i) {
    			cin >> a;
    			p[i].fi = a;
    			p[i].se = i;
    		}
    		sort(p + 1, p + 1 + n);
    		ll k = 0;
    		for (ll i = 1; i < n; ++i) {
    			if (p[n].fi - p[i].fi >= abs(p[n].se - p[i].se) + 1) {
    				cout << "YES\n" << min(p[i].se, p[n].se) << " " << max(p[i].se, p[n].se) << "\n";
    				k++
    				break;
    			}
    		}
    		if (k == 1)
    			cout << "NO\n";
    	}
    	re 0;
    }


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define re return
int main() {
	ll t;
	ios_base::sync_with_stdio(0);
	cin >> t;
	for (ll tttt = 1; tttt <= t; ++tttt) {
		ll n, k = 0;
		cin >> n;
		ll a[n + 10];
		for (ll i = 1; i <= n; ++i)
			cin >> a[i];
		for (ll i = 1; i <= n; ++i) {
			if (k == 1)
				break;
			for (ll j = i + 1; j <= n; ++j) {
				ll mx = a[i], mn = a[i], l = i, r = i;
				for (ll z = i + 1; z <= j; ++z) {
					if (mx < a[j]) {
						mx = a[j];
						r = j;
					}
					if (mn > a[j]) {
						mn = a[j];
						l = j;
					}
				}
				if (mx - mn >= n) {
					cout << "YES\n" << min(l, r) << " " << max(l, r) << "\n";
					k++;
					break;
				}
			}
		}
		if (k == 0)
			cout << "NO\n";
	}
	re 0;
}


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n, k = 0;
    		cin >> n;
    		ll a[n + 10];
    		for (ll i = 1; i <= n; ++i)
    			cin >> a[i];
    		for (ll i = 1; i <= n; ++i) {
    			if (k == 1)
    				break;
    			for (ll j = i + 1; j <= n; ++j) {
    				ll mx = a[i], mn = a[i], l = i, r = i;
    				for (ll z = i + 1; z <= j; ++z) {
    					if (mx < a[j]) {
    						mx = a[j];
    						r = j;
    					}
    					if (mn > a[j]) {
    						mn = a[j];
    						l = j;
    					}
    				}
    				if (mx - mn >= (j - i + 1)) {
    					cout << "YES\n" << min(l, r) << " " << max(l, r) << "\n";
    					k++;
    					break;
    				}
    			}
    		}
    		if (k == 0)
    			cout << "NO\n";
    	}
    	re 0;
    }


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n;
    		cin >> n;
    		ll a;
    		pair <ll, ll> p[n + 10];
    		for (ll i = 1; i <= n; ++i) {
    			cin >> a;
    			p[i].fi = a;
    			p[i].se = i;
    		}
    		sort(p + 1, p + 1 + n);
    		ll k = 0;
    		for (ll i = 1; i < n; ++i) {
    			if (p[n].fi - p[i].fi >= abs(p[n].se - p[i].se) + 1) {
    				cout << "YES\n" << min(p[i].se, p[n].se) << " " << max(p[i].se, p[n].se) << "\n";
    				k++;
    				break;
    			}
    		}
    		if (k == 1)
    			cout << "NO\n";
    	}
    	re 0;
    }


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define re return
int main() {
	ll t;
	ios_base::sync_with_stdio(0);
	cin >> t;
	for (ll tttt = 1; tttt <= t; ++tttt) {
		ll n, k = 0;
		cin >> n;
		ll a[n + 10];
		for (ll i = 1; i <= n; ++i)
			cin >> a[i];
		ll l = 1, r = n;
		while(l < r) {
			ll mx = 0;
			ll mn = 1e10;
			for (ll = l; l <= r; ++i) {
				mx = max(a[l], mx);
				mn = min(a[l], mm);
			}
			if (mx - mn >= n) {
				cout << "YES\n" << l << " " << r << "\n";
				break;
			}
		}
		if (l <= r)
			cout << "NO\n";
	}
	re 0;
}


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n, k = 0;
    		cin >> n;
    		ll a[n + 10];
    		ll mx = 0, mn = 1e10, l = 1; r = 1;
    		for (ll i = 1; i <= n; ++i) {
    			cin >> a[i];
    			if (mx > a[i]) {
    				mx = a[i];
    				r = i;
    			}
    			if (mn > a[i]) {
    				mn = a[i];
    				l = i;
    			}
    		}
    		if (mx - mn >= (r - l) + 1)
    			cout << "YES\n" << l << " " << r << "\n";
    		else
    			cout << "NO\n";
    	}
    	re 0;
    }


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define re return
int main() {
	ll t;
	ios_base::sync_with_stdio(0);
	cin >> t;
	for (ll tttt = 1; tttt <= t; ++tttt) {
		ll n, k = 0;
		cin >> n;
		ll a[n + 10];
		for (ll i = 1; i <= n; ++i)
			cin >> a[i];
		ll l = 1, r = n;
		while(l < r) {
			ll mx = 0;
			ll mn = 1e10;
			for (ll i = l; i <= r; ++i) {
				mx = max(a[i], mx);
				mn = min(a[i], mn);
			}
			if (mx - mn >= n) {
				cout << "YES\n" << l << " " << r << "\n";
				break;
			}
		}
		if (l <= r)
			cout << "NO\n";
	}
	re 0;
}


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n;
    		cin >> n;
    		ll a;
    		pair <ll, ll> p[n + 10];
    		for (ll i = 1; i <= n; ++i) {
    			cin >> a;
    			p[i].fi = a;
    			p[i].se = i;
    		}
    		sort(p + 1, p + 1 + n);
    		ll k = 0;
    		for (ll i = 1; i < n; ++i) {
    			if (p[n].fi - p[i].fi >= abs(p[n].se - p[i].se) + 1) {
    				cout << "YES\n" << min(p[i].se, p[n].se) << " " << max(p[i].se, p[n].se) << "\n";
    				k++
    				break;
    			}
    		}
    		if (k == 1)
    			cout << "NO\n";
    	}
    	re 0;
    }


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll tttt = 1; tttt <= t; ++tttt) {
    		ll n;
    		cin >> n;
    		ll a;
    		pair <ll, ll> p[n + 10];
    		for (ll i = 1; i <= n; ++i) {
    			cin >> a;
    			p[i].fi = a;
    			p[i].se = i;
    		}
    		sort(p + 1, p + 1 + n);
    		ll k = 0;
    		for (int i = n - 1; i >= 1; --i) {
    			if (k == 1)
    				break;
    			for (int j = 1; j + i <= n; j++)
    				if (p[j + i].fi - p[j].fi >= abs(p[j].se - p[j + i].se) + 1) {
    					k++;
    					cout << "YES\n" << min(p[j].se, p[j + i].se) << " " << max(p[j].se, p[j + i].se) << "\n";
    					break;
    				}
    		}
    		if (k == 0)
    			cout << "NO\n";
    	}
    	re 0;
    }


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    #define fi first
    #define se second
    #define re return
    int main() {
    	ll t;
    	ios_base::sync_with_stdio(0);
    	cin >> t;
    	for (ll i = 1; i <= t; ++i) {
    		ll n;
    		cin >> n;
    		ll mx = 0;
    		ll l = 0;
    		ll r = 0;
    		ll mn = 1e7;
    		for (ll j = 1; j <= n; ++j) {
    			ll a;
    			cin >> a;
    			if (mx <= a) {
    				mx = a;
    				r = j;
    			}
    			if (mn >= a) {
    				mn = a;
    				l = j;
    			}
    		}
    		if (mx - mn >= n) {
    			cout << "YES\n";
    			cout << min(l, r) << " " << max(l, r) << "\n";
    		}
    		else
    			cout << "NO\n";
    	}
    	re 0;
    }


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define re return
int main() {
	ll t;
	ios_base::sync_with_stdio(0);
	cin >> t;
	for (ll i = 1; i <= t; ++i) {
		ll n;
		cin >> n;
		ll mx = 0;
		ll l = 0;
		ll r = 0;
		ll mn = 1e7;
		for (ll j = 1; j <= n; ++j) {
			ll a;
			cin >> a;
			if (mx <= a) {
				mx = a;
				r = j;
			}
			if (mn >= a) {
				mn = a;
				l = j;
			}
		}
		if (mx - mn >= n) {
			cout << "YES\n";
			cout << l << " " << r << "\n";
		}
		else
			cout << "NO\n";
	}
	re 0;
}


#include <bits/stdc++.h>
#define int long long

using namespace std;

const int maxN = 1e5;

int readInt()
{
    bool minus = false;
    int result = 0;
    char ch;
    ch = getchar();
    while (true) {
        if (ch == '-')
            break;
        if (ch >= '0' && ch <= '9')
            break;
        ch = getchar();
    }
    if (ch == '-')
        minus = true;
    else
        result = ch - '0';
    while (true) {
        ch = getchar();
        if (ch < '0' || ch > '9')
            break;
        result = result * 10 + (ch - '0');
    }
    if (minus)
        return -result;
    else
        return result;
}

void turnRight(int &n, int &m, int x[], int y[], int p) {
    swap(n, m);
    for(int k = 1; k <= p; k++) {
        int i = x[k], j = y[k];
        x[k] = j;
        y[k] = m - i + 1;
    }
}
void turnHorizontal(int n, int m, int x[], int y[], int p) {
    for(int k = 1; k <= p; k++) {
        int i = x[k], j = y[k];
        x[k] = i;
        y[k] = m - j + 1;
    }
}
void print(int x[], int y[], int p) {
//    cout << endl;
    for(int i = 1; i <= p; i++) {
        cout << x[i] << " " << y[i] << endl;
    }
    cout << endl;
}
int X[maxN + 1], Y[maxN + 1];
main()
{
    int n = readInt(), m = readInt(), x = readInt(),
        y = readInt(), z = readInt(), p = readInt();
    for (int i = 1; i <= p; i++) {
        X[i] = readInt();
        Y[i] = readInt();
    }
    x %= 4;
    for(int j = 1; j <= x; j++) {
        turnRight(n, m, X, Y, p);
    }
    y %= 2;
    for(int j = 1; j <= y; j++)
        turnHorizontal(n, m, X, Y, p);
    z %= 4;
//    cout << x << " " << y << " " << z << endl;
    for(int j = 1; j <= z; j++) {
        for(int it = 1; it <= 3; it++)
            turnRight(n, m, X, Y, p);
    }
    print(X, Y, p);
//    return 0;
}


#include <bits/stdc++.h>
#define int long long

using namespace std;

const int maxN = 1e5;

int readInt()
{
    bool minus = false;
    int result = 0;
    char ch;
    ch = getchar();
    while (true) {
        if (ch == '-')
            break;
        if (ch >= '0' && ch <= '9')
            break;
        ch = getchar();
    }
    if (ch == '-')
        minus = true;
    else
        result = ch - '0';
    while (true) {
        ch = getchar();
        if (ch < '0' || ch > '9')
            break;
        result = result * 10 + (ch - '0');
    }
    if (minus)
        return -result;
    else
        return result;
}

void turnRight(int &n, int &m, int x[], int y[], int p) {
    swap(n, m);
    for(int k = 1; k <= p; k++) {
        int i = x[k], j = y[k];
        x[k] = j;
        y[k] = m - i + 1;
    }
}
void turnHorizontal(int n, int m, int x[], int y[], int p) {
    for(int k = 1; k <= p; k++) {
        int i = x[k], j = y[k];
        x[k] = i;
        y[k] = n - j + 1;
    }
}
void print(int x[], int y[], int p) {
//    cout << endl;
    for(int i = 1; i <= p; i++) {
        cout << x[i] << " " << y[i] << endl;
    }
    cout << endl;
}
int X[maxN + 1], Y[maxN + 1];
main()
{
    int n = readInt(), m = readInt(), x = readInt(),
        y = readInt(), z = readInt(), p = readInt();
    for (int i = 1; i <= p; i++) {
        X[i] = readInt();
        Y[i] = readInt();
    }
    x %= 4;
    for(int j = 1; j <= x; j++) {
        turnRight(n, m, X, Y, p);
    }
    y %= 2;
    for(int j = 1; j <= y; j++)
        turnHorizontal(n, m, X, Y, p);
    z %= 4;
//    cout << x << " " << y << " " << z << endl;
    for(int j = 1; j <= z; j++) {
        for(int it = 1; it <= 3; it++)
            turnRight(n, m, X, Y, p);
    }
    print(X, Y, p);
//    return 0;
}


#include <bits/stdc++.h>
#define int long long

using namespace std;

const int maxN = 1e5;

int readInt()
{
    bool minus = false;
    int result = 0;
    char ch;
    ch = getchar();
    while (true) {
        if (ch == '-')
            break;
        if (ch >= '0' && ch <= '9')
            break;
        ch = getchar();
    }
    if (ch == '-')
        minus = true;
    else
        result = ch - '0';
    while (true) {
        ch = getchar();
        if (ch < '0' || ch > '9')
            break;
        result = result * 10 + (ch - '0');
    }
    if (minus)
        return -result;
    else
        return result;
}
void turnRight(int n, int m, int x[], int y[], int p) {
    for(int k = 1; k <= p; k++) {
        int i = x[k], j = y[k];
        x[k] = j;
        y[k] = m - i + 1;
    }
}
void turnHorizontal(int n, int m, int x[], int y[], int p) {
    for(int k = 1; k <= p; k++) {
        int i = x[k], j = y[k];
        x[k] = n - i + 1;
        y[k] = j;
    }
}
void print(int x[], int y[], int p) {
    cout << endl;
    for(int i = 1; i <= p; i++) {
        cout << x[i] << " " << y[i] << endl;
    }
    cout << endl;
}
int X[maxN + 1], Y[maxN + 1];
main()
{
    int n = readInt(), m = readInt(), x = readInt(),
        y = readInt(), z = readInt(), p = readInt();
    for (int i = 1; i <= p; i++) {
        X[i] = readInt();
        Y[i] = readInt();
    }
    x %= 4;
    for(int j = 1; j <= x; j++) {
        turnRight(n, m, X, Y, p);
    }
    y %= 2;
    for(int j = 1; j <= y; j++)
        turnHorizontal(n, m, X, Y, p);
    z %= 4;
//    cout << x << " " << y << " " << z << endl;
    for(int j = 1; j <= z; j++) {
        for(int it = 1; it <= 3; it++)
            turnRight(n, m, X, Y, p);
    }
    for(int i = p; i >= 1; i--) {
        cout << X[i] << " " << Y[i] << endl;
    }
//    print(X, Y, p);
//    return 0;
}


#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define ll long long
#define inf 1000000000
using namespace std;
#define mod 1000000007
int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,m,x,y,z,p;
int xx[100005],yy[100005];
void clockwise()
{
    for(int i=1;i<=p;i++)
    {
        int X=xx[i],Y=yy[i];
        xx[i]=Y,yy[i]=n-X+1;
    }
    swap(n,m);
}
void rotate()
{
    for(int i=1;i<=p;i++)
        yy[i]=m-yy[i]+1;
}
int main()
{
    n=read();m=read();x=read();y=read();z=read();p=read();
    x=x%4;z=4-z%4;
    for(int i=1;i<=p;i++)
        xx[i]=read(),yy[i]=read();
    for(int i=1;i<=x;i++)clockwise();
    if(y&1)rotate();
    for(int i=1;i<=z;i++)clockwise();
    for(int i=1;i<=p;i++)
        printf("%d %d\n",xx[i],yy[i]);
    return 0;
}


#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define ll long long
#define inf 1000000000
using namespace std;
#define mod 1000000007
int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,m,x,y,z,p;
int xx[100005],yy[100005];
void clockwise()
{
    for(int i=1;i<=p;i++)
    {
        int X=xx[i],Y=yy[i];
        xx[i]=m-Y+1,yy[i]=X;
    }
    swap(n,m);
}
void rotate()
{
    for(int i=1;i<=p;i++)
        yy[i]=m-yy[i]+1;
}
int main()
{
    n=read();m=read();x=read();y=read();z=read();p=read();
    z=z%4;x=x-x%4;
    for(int i=1;i<=p;i++)
        xx[i]=read(),yy[i]=read();
    for(int i=1;i<=x;i++)clockwise();
    if(y&1)rotate();
    for(int i=1;i<=z;i++)clockwise();
    for(int i=1;i<=p;i++)
        printf("%d %d\n",xx[i],yy[i]);
    return 0;
}


#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define ll long long
#define inf 1000000000
using namespace std;
#define mod 1000000007
int read()
{
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,m,x,y,z,p;
int xx[100005],yy[100005];
void clockwise()
{
    for(int i=1;i<=p;i++)
    {
        int X=xx[i],Y=yy[i];
        xx[i]=m-Y+1,yy[i]=X;
    }
    swap(n,m);
}
void rotate()
{
    for(int i=1;i<=p;i++)
        yy[i]=m-yy[i]+1;
}
int main()
{
    n=read();m=read();x=read();y=read();z=read();p=read();
    x=x%4;z=4-z%4;
    for(int i=1;i<=p;i++)
        xx[i]=read(),yy[i]=read();
    for(int i=1;i<=x;i++)clockwise();
    if(y&1)rotate();
    for(int i=1;i<=z;i++)clockwise();
    for(int i=1;i<=p;i++)
        printf("%d %d\n",xx[i],yy[i]);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 100005
struct s
{
    int xi,yi;
}matrix[N];
int n,m,x,y,z,p;

int main() {
    scanf("%d%d%d%d%d%d",&n,&m,&x,&y,&z,&p);
    int i,j;
    for(i=0;i<p;i++)
    scanf("%d%d",&matrix[i].xi,&matrix[i].yi);
    x%=4;
    for(i=0;i<x;i++)
    {
        for (j = 0; j < p; j++)
        {
            int r = matrix[j].yi;
            int l = n + 1 - matrix[j].xi;
            matrix[j].xi = r;
            matrix[j].yi = l;
        }
    int t = n;
    n = m;
    m = t;
    }
    y%=4;
    for(i=0;i<y;i++)
    {
        for (j = 0; j < p; j++)
        matrix[j].yi = m + 1 - matrix[j].yi;
    }
    z%=4;
    for(i=0;i<z;i++)
    {
        for  (j = 0; j < p; j++)
        {
        int r = m + 1 - matrix[j].yi;
        int l = matrix[j].xi;
        matrix[j].xi = r;
        matrix[j].yi = l;
        }
    int t = n;
    n = m;
    m = t;
    }
     for (i = 0; i < p; i++)
        printf("%d %d\n",matrix[i].xi, matrix[i].yi);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 100005
struct s
{
    int xi,yi;
}matrix[N];
int n,m,x,y,z,p;

int main() {
    scanf("%d%d%d%d%d%d",&n,&m,&x,&y,&z,&p);
    int i,j;
    for(i=0;i<p;i++)
    scanf("%d%d",&matrix[i].xi,&matrix[i].yi);
    x%=4;
    for(i=0;i<x;i++)
    {
        for (j = 0; j < p; j++)
        {
            int r = matrix[j].yi;
            int l = n + 1 - matrix[j].xi;
            matrix[j].xi = r;
            matrix[j].yi = l;
        }
    int t = n;
    n = m;
    m = t;
    }
    y%=4;
    for(i=0;i<p;i++)
    {
        for (j = 0; j < p; j++)
        matrix[j].yi = m + 1 - matrix[j].yi;
    }
    z%=4;
    for(i=0;i<p;i++)
    {
        for  (j = 0; j < p; j++)
        {
        int r = m + 1 - matrix[j].yi;
        int l = matrix[j].xi;
        matrix[j].xi = r;
        matrix[j].yi = l;
        }
    int t = n;
    n = m;
    m = t;
    }
     for (i = 0; i < p; i++)
        printf("%d %d\n",matrix[i].xi, matrix[i].yi);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 100005
struct s
{
    int xi,yi;
}matrix[N];
int n,m,x,y,z,p;

int main() {
    scanf("%d%d%d%d%d%d",&n,&m,&x,&y,&z,&p);
    int i,j;
    for(i=0;i<p;i++)
    scanf("%d%d",&matrix[i].xi,&matrix[i].yi);
    x%=4;
    for(i=0;i<x;i++)
    {
        for (j = 0; j < p; j++)
        {
            int r = matrix[j].yi;
            int l = n + 1 - matrix[j].xi;
            matrix[j].xi = r;
            matrix[j].yi = l;
        }
    int t = n;
    n = m;
    m = t;
    }
    y%=4;
    for(i=0;i<p;i++)
    {
        for (j = 0; j < p; j++)
        matrix[j].yi = m + 1 - matrix[j].yi;
    }
    z%=4;
    for(i=0;i<z;i++)
    {
        for  (j = 0; j < p; j++)
        {
        int r = m + 1 - matrix[j].yi;
        int l = matrix[j].xi;
        matrix[j].xi = r;
        matrix[j].yi = l;
        }
    int t = n;
    n = m;
    m = t;
    }
     for (i = 0; i < p; i++)
        printf("%d %d\n",matrix[i].xi, matrix[i].yi);
    return 0;
}


#include<iostream>
using namespace std;

int x, y, z, p, n, m;

int main(){
	cin >> n >> m >> x >> y >> z >> p;
	int i, j, ni, nj, u, v;
	x %= 4;
	y %= 2;
	z %= 4;
	u = n; v = m;
	while (p--){
		cin >> i >> j;
		n = u; m = v;
		for (int k = 0; k < x; k++){
			ni = j;
			nj = m - i + 1;
			i = ni; j = nj;
			swap(n, m);
		}
		for (int k = 0; k < y; k++){
			j = n - j + 1;
		}
		for (int k = 0; k < z; k++){
			ni = m - j + 1;
			nj = i;
			i = ni; j = nj;
			swap(n, m);
		}
		cout << i << " " << j << endl;
	}
	return 0;
}


#include<iostream>
using namespace std;

int x, y, z, p, n, m;

int main(){
	cin >> n >> m >> x >> y >> z >> p;
	int i, j, ni, nj, u, v;
	x %= 4;
	y %= 2;
	z = (z * 3) % 4;
	u = n; v = m;
	while (p--){
		cin >> i >> j;
		n = u; m = v;
		for (int k = 0; k < x; k++){
			ni = j;
			nj = n - i + 1;
			i = ni; j = nj;
			swap(n, m);
		}
		for (int k = 0; k < y; k++){
			j = m - j + 1;
		}
		for (int k = 0; k < z; k++){
			nj = n - i + 1;
			ni = j;
			i = ni; j = nj;
			swap(n, m);
		}
		cout << i << " " << j << endl;
	}
	return 0;
}


#include<iostream>
using namespace std;

int x, y, z, p, n, m;

int main(){
	cin >> n >> m >> x >> y >> z >> p;
	int i, j, ni, nj, u, v;
	x %= 4;
	y %= 2;
	z = (z * 3) % 4;
	u = n; v = m;
	while (p--){
		cin >> i >> j;
		n = u; m = v;
		for (int k = 0; k < x; k++){
			ni = j;
			nj = m - i + 1;
			i = ni; j = nj;
			swap(n, m);
		}
		for (int k = 0; k < y; k++){
			j = m - j + 1;
		}
		for (int k = 0; k < z; k++){
			nj = m - i + 1;
			ni = j;
			i = ni; j = nj;
			swap(n, m);
		}
		cout << i << " " << j << endl;
	}
	return 0;
}


#include<iostream>
using namespace std;

int x, y, z, p, n, m;

int main(){
	cin >> n >> m >> x >> y >> z >> p;
	int i, j, ni, nj;
	x %= 4;
	y %= 2;
	z %= 4;
	while (p--){
		cin >> i >> j;
		for (int k = 0; k < x; k++){
			ni = j;
			nj = n - i + 1;
			i = ni; j = nj;
		}
		for (int k = 0; k < y; k++){
			j = n - j + 1;
		}
		for (int k = 0; k < z; k++){
			ni = m - j + 1;
			nj = i;
			i = ni; j = nj;
		}
		cout << i << " " << j << endl;
	}
	return 0;
}


#include<iostream>
using namespace std;

int x, y, z, p, n, m;

int main(){
	cin >> n >> m >> x >> y >> z >> p;
	int i, j, ni, nj;
	x %= 4;
	y %= 2;
	z %= 4;
	while (p--){
		cin >> i >> j;
		for (int k = 0; k < x; k++){
			ni = j;
			nj = n - i + 1;
			i = ni; j = nj;
		}
		for (int k = 0; k < y; k++){
			i = i;
			j = n - j;
		}
		for (int k = 0; k < z; k++){
			ni = m - j + 1;
			nj = i;
			i = ni; j = nj;
		}
		cout << --i << " " << j << endl;
	}
	return 0;
}