#include <iostream>
#include <fstream>
#include <vector>

using namespace std;

ifstream in("input.txt");
ofstream out("output.txt");

int n;
int merg[23];
vector <int> vec[22];

int main()
{
    in >> n;
    if (n == 2)
    {
        out << "1\n1 1";
        return 0;
    }
    int i = (1<<20);
    while (i >= 0)
    {
        int ok = 0;
        for (int j=1; j<=n; j++)
        {
            if (j&i)
            {
                ok++;
            }
        }
        if (ok >= 1) break;
        i /= 2;
    }
    int ok = i;
    int cnt = 0;
    for (int i=0; i<ok; i++)
    {
        for (int j=1; j<=n; j++)
        {
            if (j&(1<<i)) vec[i].push_back(j);
        }
        if (vec[i].size() != n) merg[i] = 1,cnt++;
    }
    out << cnt << "\n";
    for (int i=0; i<ok; i++)
    {
        if (merg[i])
        {
           /// cout << vec[i].size() << " ";
            for (int j=0; j<vec[i].size(); j++) out << vec[i][j] << " ";
            if (i < ok-1) out << "\n";
        }
    }
    return 0;
}


#include <iostream>
#include <fstream>
#include <vector>

using namespace std;

ifstream in("input.txt");
ofstream out("output.txt");

int n;
int merg[23],a[1005][1005];
vector <int> vec1[22],vec2[22];

bool Merge()
{
    int sum = 0;
    for (int i=1; i<=n; i++)
    {
        for (int j=1; j<=n; j++)
        {
            sum += a[i][j];
        }
    }
    return (sum == n*n - n);
}

int main()
{
    in >> n;
    if (n == 2)
    {
        out << "1\n1 1";
        return 0;
    }
    n--;
    int i = (1<<20);
    while (i >= 0)
    {
        int ok = 0;
        for (int j=1; j<=n; j++)
        {
            if (j&i)
            {
                ok++;
            }
        }
        if (ok >= 1) break;
        i /= 2;
    }
    n++;
    int ok = i;
    int cnt = 0;
    for (int i=0; i<ok; i++)
    {
        for (int j=1; j<=n; j++)
        {
            if (j&(1<<i))
            {
                vec1[i].push_back(j);
            }
            else vec2[i].push_back(j);
        }
    }
    for (int i=0; i<ok; i++)
    {
        if (vec1[i].size() != n && vec1[i].size() > 0)
        {
            for (int j=0; j<vec1[i].size(); j++)
            {
                for (int p=0; p<vec2[i].size(); p++)
                {
                    a[vec1[i][j]][vec2[i][p]] = 1;
                    a[vec2[i][p]][vec1[i][j]] = 1;
                }
            }
            cnt++;
            if (Merge()) break;
        }
    }
    out << cnt << "\n";
    int p = 0;
    for (int i=0; i<ok; i++)
    {
        if (vec1[i].size() != n && vec1[i].size() > 0)
        {
            out << vec1[i].size() << " ";
            for (int j=0; j<vec1[i].size(); j++) out << vec1[i][j] << " ";
            out << "\n";
            p++;
            if (p == cnt) break;
        }
    }
    return 0;
}


#include <iostream>
#include <fstream>
#include <vector>

using namespace std;

ifstream in("input.txt");
ofstream out("output.txt");

int n;
int merg[23];
vector <int> vec[22];

int main()
{
    in >> n;
    if (n == 2)
    {
        out << "1\n1 1";
        return 0;
    }
    n--;
    int i = (1<<20);
    while (i >= 0)
    {
        int ok = 0;
        for (int j=1; j<=n; j++)
        {
            if (j&i)
            {
                ok++;
            }
        }
        if (ok >= 1) break;
        i /= 2;
    }
    n++;
    int ok = i;
    int cnt = 0;
    for (int i=0; i<ok; i++)
    {
        for (int j=1; j<=n; j++)
        {
            if (j&(1<<i))
            {
                vec[i].push_back(j);
                ///cout << j << " ";
            }
        }
        if (vec[i].size() != n) merg[i] = 1,cnt++;
    }
    out << cnt << "\n";
    for (int i=0; i<ok; i++)
    {
        if (merg[i])
        {
            out << vec[i].size() << " ";
            for (int j=0; j<vec[i].size(); j++)
            {
                out << vec[i][j] << " ";
            }
            out << "\n";
        }
    }
    return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <cmath>

using namespace std;

ifstream in("input.txt");
ofstream out("output.txt");

int n;
int merg[23],a[1005][1005];
vector <int> vec1[1000],vec2[1000];

bool Merge()
{
    int sum = 0;
    for (int i=1; i<=n; i++)
    {
        for (int j=1; j<=n; j++)
        {
            sum += a[i][j];
        }
    }
    return (sum == n*n - n);
}

int main()
{
    in >> n;
    if (n == 2)
    {
        out << "1\n1 1";
        return 0;
    }
    n--;
    int ok = log2(n);
    n++;
    int cnt = 0;
    for (int i=0; i<=ok; i++)
    {
        for (int j=1; j<=n; j++)
        {
            //cout << i << " " << j << "\n";
            if (j&(1<<i))
            {
                vec1[i].push_back(j);
            }
            else vec2[i].push_back(j);
        }
    }
    for (int i=0; i<=ok; i++)
    {
        if (vec1[i].size() != n && vec1[i].size() > 0)
        {
            for (int j=0; j<vec1[i].size(); j++)
            {
                for (int p=0; p<vec2[i].size(); p++)
                {
                    a[vec1[i][j]][vec2[i][p]] = 1;
                    a[vec2[i][p]][vec1[i][j]] = 1;
                }
            }
            cnt++;
            if (Merge()) break;
        }
    }
    out << cnt << "\n";
    int p = 0;
    for (int i=0; i<=ok; i++)
    {
        if (vec1[i].size() != n && vec1[i].size() > 0)
        {
            out << vec1[i].size() << " ";
            for (int j=0; j<vec1[i].size(); j++) out << vec1[i][j] << " ";
            out << "\n";
            p++;
            if (p == cnt) break;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ios ios_base::sync_with_stdio(0);cin.tie(0);
typedef long long ll;

int n;

int main(){

  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);

  cin >> n;

  int tmp = ((int)ceil(log2(n)));

  cout << tmp << '\n';

  tmp = (1 << tmp);
  tmp/=2;

  while(tmp){
    vector<int>team;
    int i = 0;
    for( ; i < n; ){
        for(int j = i; j < min(i + tmp, n); j++)
          team.push_back(j + 1);
        i+=(tmp * 2);
    }
    cout << team.size();
    for(int i = 0; i < team.size(); i++)
      cout << ' ' << team[i];
    puts("");
    tmp/=2;
  }

}


#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ios ios_base::sync_with_stdio(0);cin.tie(0);
typedef long long ll;

int n;

int main(){

  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);

  cin >> n;

  int tmp = ((int)ceil(log2(n)));

  cout << tmp << '\n';

  tmp = (1 << tmp);
  tmp/=2;

  while(tmp){
    vector<int>team;
    int i = 0;
    for( ; i < n; ){
        for(int j = i; j < i + tmp; j++)
          team.push_back(j + 1);
        i+=(tmp * 2);
    }
    cout << team.size();
    for(int i = 0; i < team.size(); i++)
      cout << ' ' << team[i];
    puts("");
    tmp/=2;
  }

}


#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ios ios_base::sync_with_stdio(0);cin.tie(0);
typedef long long ll;

int n;

int main(){

  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);

  cin >> n;

  int tmp = ((int)ceil(log2(n)));

  cout << tmp << '\n';

  tmp = (1 << tmp);
  tmp/=2;

  while(tmp){
    vector<int>team;
    int i = 0;
    for( ; i < n; ){
        for(int j = i; j < min(i + tmp, n+1); j++)
          team.push_back(j + 1);
        i+=(tmp * 2);
    }
    cout << team.size();
    for(int i = 0; i < team.size(); i++)
      cout << ' ' << team[i];
    puts("");
    tmp/=2;
  }

}


/*
 * DATE : 2017-07-07
 * Algo :
*/
#include<bits/stdc++.h>
using namespace std;
/*------- Constants---- */

#define LL                      long long
#define Ulong                   unsigned long long
#define FOR(I,A,B)              for(long long i=0; i < n ; i++ )
#define REP(i,n)                for(long long i=0; i < n ; i++ )
#define mp                      make_pair
#define pb                      push_back
#define all(x)                  (x).begin(),(x).end()
#define PI                      acos(-1.0)
#define EPS                     1e-9
#define F                       first
#define S                       second
#define di(x)                   int x; input(x)
#define in(x)                   input(x)
#define in2(x,y)                in(x),in(y)
#define in3(x,y,z)              in(x),in2(y,z)
#define lc                      ((n)<<1)
#define rc                      ((n)<<1|1)
#define db(x)                   cout << #x << " -> " << x << endl;
#define ms(ara_name,value)      memset(ara_name,value,sizeof(ara_name))
#define IO                      ios_base::sync_with_stdio(0);cin.tie(0)
#define READ                    freopen("in.txt","r",stdin)
#define WRITE                   freopen("out.txt","w",stdout)
template<class T> inline void input(T &x) {
    register char c = getchar();x = 0;
    int neg = 0;
    for(; ((c<48 || c>57) && c != '-'); c = getchar());
    if(c=='-'){neg = 1;c = getchar();}
    for(; c>47 && c<58 ; c = getchar()){x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x = -x;
}
inline long long bigmod(long long p,long long e,long long M){
    long long ret = 1;
    for(; e > 0; e >>= 1){
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    } return ret;
}
template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}

/***************************** END OF TEMPLATE *******************************/

const int N = 1001;
vector<int> game[1005];
int n;
void solve(int lev,int l,int r)
{
    if(l == r) return;
    int mid = (l + r)/2;
    for(int i = l; i <= mid;i ++ ) game[lev].push_back(i);
    solve(lev + 1, l , mid);
    solve(lev + 1, mid+1, r);
}
int main()
{
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    cin >> n;
    solve(0,1,n);
    int Ans = 0;
    for(int i = 0; i < N; i ++ ) {
        if(game[i].size()) {
            Ans = i + 1;
        }
    }
    cout << Ans <<endl;
    for(int i = 0; i < Ans;i ++ ){
        printf("%d",game[i].size());
        for(auto x: game[i]) printf(" %d", x);
        printf("\n");
    }
    return 0;
}


//
//  main.cpp
//  G. Practice
//
//  Created by y.m on 18.08.20.
//

#include <iostream>
#include <cmath>
#include <vector>
#include <math.h>

using namespace std;

int main(int argc, const char * argv[]) {
    ios::sync_with_stdio(0); cin.tie(0);
    float n;
    cin>>n;

    int z= ceil(log2(n));
    cout<<z<<"\n";
    vector<int> v;
    vector<int> ans;
    ans.push_back(0);

    for(int i = 0; i<=n; i++)
    {
        v.push_back(i);
    }

    for(int i = 1; i<=z; i++)
    {
        int k = 1<<i;

        for(int q=1; q<=n;q+=k)
        {
            for(int x=0; x<k/2; x++)
            {
                if(x + q<=n)
                ans.push_back(v[x+q]);
            }

        }

        cout<<ans.size()-1<<" ";

        for(int z= 1; z<=ans.size() - 1;z++)
        {
            cout<<ans[z]<<" ";
        }
        cout<<"\n";
        ans = vector<int>();
        ans.push_back(0);
    }

    return 0;
}


//
//  main.cpp
//  G. Practice
//
//  Created by y.m on 18.08.20.
//

#include <iostream>
#include <cmath>
#include <vector>
#include <math.h>

using namespace std;

int main(int argc, const char * argv[]) {
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    ios::sync_with_stdio(0); cin.tie(0);
    float n;
    cin>>n;

    int z= ceil(log2(n));
    cout<<z<<"\n";
    vector<int> v;
    vector<int> ans;
    ans.push_back(0);

    for(int i = 0; i<=n; i++)
    {
        v.push_back(i);
    }

    for(int i = 1; i<=z; i++)
    {
        int k = 1<<i;

        for(int q=1; q<=n;q+=k)
        {
            for(int x=0; x<k/2; x++)
            {
                if(x + q<=n)
                ans.push_back(v[x+q]);
            }

        }

        cout<<ans.size()-1<<" ";

        for(int z= 1; z<=ans.size() - 1;z++)
        {
            cout<<ans[z]<<" ";
        }
        cout<<"\n";
        ans = vector<int>();
        ans.push_back(0);
    }

    return 0;
}


#include <iostream>
using namespace std;
#include <bits/stdc++.h>
using namespace std;
vector <vector<int>> a;
int aux;
void search (int l, int r, int i){
    aux=i;
    int m=(l+r)/2;
    for(int j=l;j<m;j++){
        a[i].push_back(j+1);
    }
    if(m!=l+1){
        search(l,m,i+1);
    }
    if(r!=m+1){
        search(m,r,i+1);
    }

}

int main() {
    freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	a.resize(10000);
	int n;
	cin>>n;
    search(0,n,0);
    cout<<aux+1<<"\n";
    for(int i=0;i<aux+1;i++){
        cout<<a[i].size()<<" ";
        for(int j=0;j<a[i].size();j++){
            cout<<a[i][j]<<" ";
        }
        cout<<"\n";
    }

}


#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define range(i,a,b) for(ll i=a;i<b;i++)
#define pb push_back
#define inf LLONG_MAX
#define vi vector<int>
#define vll vector<ll>
#define all(v) (v).begin(), (v).end()
#define mod 1000000007

int n;

int main(){
	// IOS
	freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
	cin>>n;
	cout<<ceil(log2(n))<<endl;
	range(i,0,ceil(log2(n))){
		vi players;
		range(j,1,n+1){
			if(j&(1<<i)){
				players.pb(j);
			}
		}
		cout<<players.size()<<" ";
		for(int x: players){
			cout<<x<<" ";
		}
		cout<<endl;
	}
}
// 4
// 12 34
// 14 32

//8
// 3 games
// 2468 1357
//
// 0001
// 0010
// 0011
// 0100
// 0101
// 0110
// 0111
// 1000

// ways = ceil(log2(n))


#include <stdio.h>
#include <vector>
int main() {
  FILE *in = fopen("input.txt", "r"), *out = fopen("output.txt", "w");
  int n;
  fscanf(in, "%d", &n);
  int ans = 1;
  while ((1 << ans) < n)
    ++ans;
  fprintf(out, "%d\n", ans);
  for (int i = 0; i < ans; ++i) {
    std::vector<int> v;
    for (int j = 1; j <= n; ++j)
      if (j & 1 << i)
        v.push_back(j);
    fprintf(out, "%d", (int)v.size());
    for (int t:v)
      fprintf(out, " %d", t);
    fputc(out, '\n');
  }
  return 0;
}


#include <stdio.h>
#include <vector>
int main() {
  FILE *in = fopen("input.txt", "r"), *out = fopen("output.txt", "w");
  int n;
  fscanf(in, "%d", &n);
  int ans = 1;
  while ((1 << ans) < n)
    ++ans;
  fprintf(out, "%d\n", ans);
  for (int i = 0; i < ans; ++i) {
    std::vector<int> v;
    for (int j = 1; j <= n; ++j)
      if (j & 1 << i)
        v.push_back(j);
    fprintf(out, "%d", (int)v.size());
    for (int t:v)
      fprintf(out, " %d", t);
    fputc('\n', out);
  }
  return 0;
}


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

const int MAXN = 1000;

vector<int> juegos[MAXN + 2];
int n, m;

void acomoda(int ini, int fin, int nivel){
    m = max(m, nivel);
    if(ini >= fin){
        return;
    }
    int mitad = (ini + fin) / 2;
    acomoda(ini, mitad, nivel + 1);
    acomoda(mitad + 1, fin, nivel + 1);
    for(int i = ini; i <= mitad; i++){
        juegos[nivel + 1].push_back(i);
    }
}

int main(){
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    cin >> n;
    acomoda(1, n, 0);
    cout << m;
    cout << "\n";
    for(int i = 1; i <= m; i++){
        cout << juegos[i].size();
        for(auto j : juegos[i]){
            cout << " " << j;
        }
        cout << "\n";
    }
    return 0;
}


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

const int MAXN = 1000;

vector<int> juegos[MAXN + 2];
int n, m;

void acomoda(int ini, int fin, int nivel){
    m = max(m, nivel);
    if(ini >= fin){
        return;
    }
    int mitad = (ini + fin) / 2;
    acomoda(ini, mitad, nivel + 1);
    acomoda(mitad + 1, fin, nivel + 1);
    for(int i = ini; i <= mitad; i++){
        juegos[nivel + 1].push_back(i);
    }
}

int main(){
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    cin >> n;
    acomoda(1, n, 0);
    cout << m << "\n";
    for(int i = 1; i <= m; i++){
        cout << juegos[i].size();
        for(auto j : juegos[i]){
            cout << " " << j;
        }
        cout << "\n";
    }
    return 0;
}


#include "stdio.h"
#include "math.h"
#include "vector"
#include "algorithm"
using namespace std;
void bsearch(int left,int right,int index);
int n,sizex,d[1025]={},limit=-1;
vector<int> v[11];
int main(){
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    scanf("%d",&n);
    sizex=(int)pow(2,ceil(log2(n)));
    for(int i=1;i<=sizex;i++) d[i]=i;
    for(int i=1;i<=n/2;i++) v[0].push_back(d[i]);
    bsearch(1,sizex/2,1);
    printf("%d\n",limit);
    for(int i=0;i<limit+1;i++){
        if(v[i].size()==0) continue;
        printf("%d ",v[i].size());
        for(int j=0;j<v[i].size();j++) printf("%d ",v[i][j]);
        printf("\n");
    }
}
void bsearch(int left,int right,int index){
    limit=max(limit,index);
    int mid=(left+right)/2;
    if(left!=1||right!=sizex/2){
        for(int i=left;i<=right;i++){
            if(d[i]<=n) v[index].push_back(d[i]);
        }
    }
    for(int i=mid+1;i<=right;i++) d[i]+=(mid-left+1);
    if(left!=right){
        bsearch(left,mid,index+1);
        bsearch(mid+1,right,index+1);
    }
    else v[index+1].push_back(d[left]);
}


#include<iostream>
#include<vector>
#include <algorithm>

using namespace std;

void sw(vector<int> &table1, vector<int> &table2, int begin, int len) {
	for (int i = 1; i <= len/2; i++) {
		swap(table1[i + begin], table2[i + begin]);
	}
}

int main() {
	int n;
	cin >> n;
	vector<int> table1(n + 1,0);
	vector<int> table2(n + 1,0);
	int cnt = ceil(log(n) / log(2));
	cout << cnt << endl;
	int half = 1 << (cnt - 1);//siz为填补后的人数一半
	for (int i = 1; i <= half; i++) {
		table1[i] = i;
	}
	for (int i = 1; i + half <= n; i++) {
		table2[i] = i + half;
	}
	//n=2^p推出有多少人
	for (int len = half; len != 0; len >>= 1) {
		cnt = 0;
		for (int j = 1; j <= half; j++) {
			if (table1[j]) {
				cnt++;
			}

		}
		cout << cnt << " ";
		for (int j = 1; j <= half; j++) {
			if (table1[j])
			{
				cout << table1[j] << " ";
			}
		}
		cout << endl;
		sw(table1, table2, 0, len);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
using namespace std;
vector<int> v,v2;

void swap_v(int bg,int len)
{

    int i;
    for(i=0; i<len/2; i++)
    {
        v[bg+i]=v[bg+i]^v2[bg+i]^(v2[bg+i]=v[bg+i]); //位运算交换
    }
}

int main()
{

    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    int n,i,j;

    while(cin>>n)
    {
        int cnt=ceil(log(n)/log(2));
        ;
        cout<<cnt<<endl;
        int siz  =1<<(cnt-1) ;//siz为填补后的人数一半
        v.clear();
        v2.clear();
        v.resize(siz+1);
        v2.resize(siz+1);
        for(i=1; i<=siz; i++)
        {
            v[i]=i;          //初始化
        }
        for(i=1; i+siz<=n; i++)
        {

            v2[i]=i+siz;
        }

        int len=siz;  //len为跨距

        for(; len!=0; len>>=1)
        {
            cnt=0;
            for(j=1; j<=siz; j++)
            {
                if(v[j])
                {
                    cnt++;
                }
            }
            cout<<cnt;  //输出一队人数
            for(j=1; j<=siz; j++)
            {
                if(v[j])
                {
                    cout<<" "<<v[j];   //不是替补0就输出
                }
            }
            cout<<endl;

            for(j=1; j<=siz&&len!=1; j+=len)
            {

                swap_v(j,len);           //每len个人交换前len/2个人
            }

        }

    }

    fclose(stdin);
    fclose(stdout);

    return 0;

}


#include <iostream>
#include<fstream>

using namespace std;

int a[11][1000];

int log_2(int n)
{
    int c=0,x=1;
    while(n>x)
    {
        c++;
        x*=2;
    }
    return c;
}

void functie(int st, int dr, int nr)
{
    int mij=(dr+st)/2;
    for(int i=0;i<=mij;i++)
    {
        a[nr][0]++;
        a[nr][a[nr][0]]=1;
    }
        if(st==dr)
            return;
        functie(st,mij,nr+1);
        functie(mij+1,dr,nr+1);

}

int main()
{
    ifstream in("input.txt");
    ofstream out("output.txt");
    int n;
    in>>n;
    int nn=log_2(n);
    functie(1,n,0);
    for(int i=0;i<nn;i++)
    {
        for(int j=0;j<a[i][0];j++)
            out<<a[i][j]<<" ";
        out<<"\n";
    }
    return 0;
}


#include <iostream>
#include<fstream>

using namespace std;

int a[11][1000];

int log_2(int n)
{
    int c=0,x=1;
    while(n>x)
    {
        c++;
        x*=2;
    }
    return c;
}

void functie(int st, int dr, int nr)
{
    int mij=(dr+st)/2;
    for(int i=st;i<=mij;i++)
    {
        a[nr][0]++;
        a[nr][a[nr][0]]=i;
    }
        if(st==dr)
            return;
        functie(st,mij,nr+1);
        functie(mij+1,dr,nr+1);

}

int main()
{
    ifstream in("input.txt");
    ofstream out("output.txt");
    int n;
    in>>n;
    int nn=log_2(n);
    out<<nn<<"\n";
    functie(1,n,0);
    for(int i=0;i<nn;i++)
    {
        for(int j=0;j<=a[i][0];j++)
            out<<a[i][j]<<" ";
        out<<"\n";
    }
    return 0;
}


#include <iostream>
#include<fstream>

using namespace std;

int a[11][1000];

int log_2(int n)
{
    int c=0,x=1;
    while(n>x)
    {
        c++;
        x*=2;
    }
    return c;
}

void functie(int st, int dr, int nr)
{
    int mij=(dr+st)/2;
    for(int i=0;i<=mij;i++)
    {
        a[nr][0]++;
        a[nr][a[nr][0]]=1;
    }
        if(st==dr)
            return;
        functie(st,mij,nr+1);
        functie(mij+1,dr,nr+1);

}

int main()
{
    ifstream in("input.in");
    ofstream out("output.out");
    int n;
    in>>n;
    int nn=log_2(n);
    functie(1,n,0);
    for(int i=0;i<nn;i++)
    {
        for(int j=0;j<a[i][0];j++)
            out<<a[i][j]<<" ";
        out<<"\n";
    }
    return 0;
}


#include <iostream>
#include<fstream>

using namespace std;

int a[11][1000];

int log_2(int n)
{
    int c=0,x=1;
    while(n>x)
    {
        c++;
        x*=2;
    }
    return c;
}

void functie(int st, int dr, int nr)
{
    int mij=(dr+st)/2;
    for(int i=0;i<=mij;i++)
    {
        a[nr][0]++;
        a[nr][a[nr][0]]=i;
    }
        if(st==dr)
            return;
        functie(st,mij,nr+1);
        functie(mij+1,dr,nr+1);

}

int main()
{
    ifstream in("input.txt");
    ofstream out("output.txt");
    int n;
    in>>n;
    int nn=log_2(n);
    functie(1,n,0);
    for(int i=0;i<nn;i++)
    {
        for(int j=0;j<a[i][0];j++)
            out<<a[i][j]<<" ";
        out<<"\n";
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<tuple>
#include<cstring>
#include<vector>
#include<functional>
#include<cmath>
#include<numeric>
#include<map>
#include<unordered_map>

#define bug(x) #x<<'='<<x
#define mt make_tuple
#define mp make_pair
#define getbit(x,i) ((x>>i)&1)

using namespace std;

using pii=pair<int,int>;
using lli=long long int;
using iii=tuple<int,int,int>;

const int maxn=1e6;
const int maxm=1e7;
const int maxl=18;
const int inf=0x3f3f3f3f;
const lli INF=0x3f3f3f3f3f3f3f3f;
const char sp=' ';
const char dl='\n';
const int mod=1e9+7;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#ifndef ONLINE_JUDGE
    freopen("t.inp","r",stdin);//freopen("t.out","w",stdout);
#endif // ONLINE_JUDGE
	int t;t=1;
	//cin>>t;
	while(t--){
		int n;cin>>n;
		vector<vector<int>> res;
		function<void(int,int)> divide_and_conquer=[&](int l,int r){
			if(l==r||l>r) return ;
			int mid=(l+r)>>1;
			res.push_back({});
			for(int i=1;i<=mid;i++) res.back().push_back(i);
			divide_and_conquer(l,mid);
			divide_and_conquer(mid+1,r);
			return ;
		};
		divide_and_conquer(1,n);
		cout<<res.size()<<'\n';
		for(const auto&i:res){
			cout<<i.size()<<' ';
			for(const auto&j:i)
				cout<<j<<' ';
			cout<<'\n';
		}
	}
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<tuple>
#include<cstring>
#include<vector>
#include<functional>
#include<cmath>
#include<numeric>
#include<map>
#include<unordered_map>

#define bug(x) #x<<'='<<x
#define mt make_tuple
#define mp make_pair
#define getbit(x,i) ((x>>i)&1)

using namespace std;

using pii=pair<int,int>;
using lli=long long int;
using iii=tuple<int,int,int>;

const int maxn=1e6;
const int maxm=1e7;
const int maxl=18;
const int inf=0x3f3f3f3f;
const lli INF=0x3f3f3f3f3f3f3f3f;
const char sp=' ';
const char dl='\n';
const int mod=1e9+7;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#ifndef ONLINE_JUDGE
    freopen("t.inp","r",stdin);freopen("t.out","w",stdout);
#endif // ONLINE_JUDGE
	int t;t=1;
	//cin>>t;
	while(t--){
		int n;cin>>n;
		vector<vector<int>> res;
		vector<pii> p;
		p.push_back(pii(1,n));
		int just=0,last=1;
		while(1){
			res.push_back({});
			for(int i=just;i<last;i++){
				int l=p[i].first,r=p[i].second;
				if(l>=r) continue;
				int mid=(l+r)>>1;
				for(int j=l;j<=mid;j++) res.back().push_back(j);
				p.push_back(pii(l,mid));
				p.push_back(pii(mid+1,r));
			}
			if(last==p.size()) break;
			just=last;
			last=p.size();
		}
		for(int i=0;i<res.size();)
			if(res[i].size()==0) res.erase(res.begin()+i);
			else i++;
		cout<<res.size()<<'\n';
		for(const auto&i:res){
			cout<<i.size()<<' ';
			for(const auto&j:i)
				cout<<j<<' ';
			cout<<'\n';
		}
	}
    return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<tuple>
#include<cstring>
#include<vector>
#include<functional>
#include<cmath>
#include<numeric>
#include<map>
#include<unordered_map>

#define bug(x) #x<<'='<<x
#define mt make_tuple
#define mp make_pair
#define getbit(x,i) ((x>>i)&1)

using namespace std;

using pii=pair<int,int>;
using lli=long long int;
using iii=tuple<int,int,int>;

const int maxn=1e6;
const int maxm=1e7;
const int maxl=18;
const int inf=0x3f3f3f3f;
const lli INF=0x3f3f3f3f3f3f3f3f;
const char sp=' ';
const char dl='\n';
const int mod=1e9+7;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
//#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
//#endif // ONLINE_JUDGE
	int t;t=1;
	//cin>>t;
	while(t--){
		int n;cin>>n;
		vector<vector<int>> res;
		vector<pii> p;
		p.push_back(pii(1,n));
		int just=0,last=1;
		while(1){
			res.push_back({});
			for(int i=just;i<last;i++){
				int l=p[i].first,r=p[i].second;
				if(l>=r) continue;
				int mid=(l+r)>>1;
				for(int j=l;j<=mid;j++) res.back().push_back(j);
				p.push_back(pii(l,mid));
				p.push_back(pii(mid+1,r));
			}
			if(last==p.size()) break;
			just=last;
			last=p.size();
		}
		for(int i=0;i<res.size();)
			if(res[i].size()==0) res.erase(res.begin()+i);
			else i++;
		cout<<res.size()<<'\n';
		for(const auto&i:res){
			cout<<i.size()<<' ';
			for(const auto&j:i)
				cout<<j<<' ';
			cout<<'\n';
		}
	}
    return 0;
}


#include <fstream>

using namespace std;

const int N = 1000;
const int L = 11;

int a[L][N];

int log2(int n)
{
    int e = 0, p = 1;
    while (p < n)
    {
        e++;
        p *= 2;
    }
    return e;
}

void practice(int st, int dr, int nr)
{
    int m = (st + dr) / 2;
    for (int i = st; i <= m; i++)
    {
        a[nr][0]++;
        a[nr][a[nr][0]] = i;
    }
    if (st == dr)
    {
        return;
    }

    practice(st, m, nr + 1);
    practice(m + 1, dr, nr + 1);
}

int main()
{
    int n, nr;
    ifstream in("input.txt");
    ofstream out("output.txt");
    in >> n;
    out << (nr = log2(n)) << "\n";
    practice(1, n, 0);
    for (int i = 0; i < nr; i++)
    {
        for (int j = 0; j <= a[i][0]; j++)
        {
            out << a[i][j] << " ";
        }
        out << "\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int MAX=1000;
int n,ans[MAX][MAX],m;
void cal(int l,int r,int h=0)
{
	if (r-l==1) return ;
	int mid=l+r>>1;
	m=max(m,h+1);
	for (int i=l;i<mid;i++) ans[h][i]=1;
	cal(l,mid,h+1);
	cal(mid,r,h+1);
}
int main()
{
	ifstream cin("input.txt");
	ofstream cout("output.txt");
	ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n;
	cal(0,n);
	cout<<m<<endl;
	for (int i=0;i<m;i++)
	{
		vector<int> k;
		for (int j=0;j<n;j++) if (ans[i][j]) k.push_back(j+1);
		cout<<k.size()<<' ';
		for (auto i:k) cout<<i<<' ';
		cout<<endl;
	}
	return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>

using namespace std;
int maps[1000][10000];
int n;
int mx;
void pr(int step,int l,int r)
{
    if(l==r) return;
    if(step>mx)
        mx=step;
    int mid=(l+r)/2;
    for(int i=l;i<=mid;i++)
        maps[step][i]=1;
    pr(step+1,l,mid);
    pr(step+1,mid+1,r);
}
int main()
{
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    memset(maps,0,sizeof(maps));
    cin>>n;
    mx=0;
    pr(1,1,n);
    cout<<mx<<endl;
    for(int i=1;i<=mx;i++)
    {
        int cnt=0;
        for(int j=1;j<=n;j++)
        {
            if(maps[i][j]) cnt++;
        }
        cout<<cnt;
        for(int j=1;j<=n;j++)
            if(maps[i][j]) cout<<" "<<j;
        cout<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define D(x) cout << (#x) << " is " << x << endl;
#define Q int t; scanf("%d", &t); for(int q=1; q<=t; q++)
typedef long long int lli;
typedef pair<int, int> pi;

int main()
{
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
    int n;
    cin >> n;
    n--;
    cout << n << endl;

    while(n){
		cout << n;
		for(int i=1; i<=n; i++) cout << " " << i;
		cout << endl;
		n--;
	}

    return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        F(i,0,n-1){
            if(abs(v[i+1]-v[i])>=2){
                cout<<"yes\n";
                cout<<i+1<<" "<<i+2<<endl;
                f=1;
                break;
            }
        }
        if(!f)
            cout<<"no\n";
    }

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        auto it=max_element(all(v)),it1=min_element(all(v));
        a=it-v.begin();
        b=it1-v.begin();
        if(*it-*it1>=abs(a-b)+1){
            cout<<"yes\n";
            cout<<min(b+1,a+1)<<" "<<max(a+1,b+1)<<endl;
        }else{
            if(v.size()>2){
                F(i,a,b){
                    if(v[i+1]-v[i]>=2){
                        cout<<"yes\n";
                        cout<<i<<" "<<i+1<<endl;
                        f=1;
                        break;
                    }
                }

            }
            if(!f)
                cout<<"no\n";
        }
    }

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        auto it=max_element(all(v)),it1=min_element(all(v));
        a=it-v.begin();
        b=it1-v.begin();
        if(*it-*it1>=abs(a-b)+1){
            cout<<"yes\n";
            cout<<min(b+1,a+1)<<" "<<max(a+1,b+1)<<endl;
        }else{
            if(v.size()>2){
                s=max(a,b);
                for(int j=s;j>min(a,b)+1;--j){
                F(i,min(a,b)+1,max(a,b)){
                    if(v[s]-v[i]>=s-i+1){
                        cout<<"yes\n";
                        cout<<i+1<<" "<<max(a+1,b+1)<<endl;
                        f=1;
                        break;
                    }
                }

                }

            }
            if(!f)
                cout<<"no\n";
        }
    }

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        auto it=max_element(all(v)),it1=min_element(all(v));
        a=it-v.begin();
        b=it1-v.begin();
        if(*it-*it1>=abs(a-b)+1){
            cout<<"yes\n";
            cout<<min(b+1,a+1)<<" "<<max(a+1,b+1)<<endl;
        }else{
            if(v.size()>2){
                s=max(a,b);
                for(int j=s;j>min(a,b)+1;--j){

                F(i,min(a,b)+1,max(a,b)){
                    it=max_element(v.begin()+i,v.begin()+j+1);
                    it1=min_element(v.begin()+i,v.begin()+j+1);
                    c=it1-v.begin();s=it-v.begin();
                    if(*it-*it1>=abs(s-c)+1){
                        cout<<"yes\n";
                        cout<<min(c+1,s+1)<<" "<<max(c+1,s+1)<<endl;
                        f=1;
                        break;
                    }
                }

                }

            }
            if(!f)
                cout<<"no\n";
        }
    }

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        auto it=max_element(all(v)),it1=min_element(all(v));
        a=it-v.begin();
        b=it1-v.begin();
        if(*it-*it1>=abs(a-b)+1){
            cout<<"yes\n";
            cout<<min(b+1,a+1)<<" "<<max(a+1,b+1)<<endl;
        }else{
            if(v.size()>2){
                s=max(a,b);
                for(int j=s;j>min(a,b)+1;--j){

                F(i,min(a,b)+1,max(a,b)){
                    if(j<=i){
                        break;
                        s=-1;
                    }
                    it=max_element(v.begin()+min(i,j),v.begin()+max(i,j)+1);
                    it1=min_element(v.begin()+min(i,j),v.begin()+max(i,j)+1);
                    c=it1-v.begin();s=it-v.begin();
                    if(*it-*it1>=abs(s-c)+1){
                        cout<<"yes\n";
                        cout<<min(c+1,s+1)<<" "<<max(c+1,s+1)<<endl;
                        f=1;
                        break;
                    }
                }
                    if(s==-1)
                        break;
                }

            }
            if(!f)
                cout<<"no\n";
        }
    }

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        auto it=max_element(all(v)),it1=min_element(all(v));
        a=it-v.begin();
        b=it1-v.begin();
        if(*it-*it1>=abs(a-b)+1){
            cout<<"yes\n";
            cout<<min(b+1,a+1)<<" "<<max(a+1,b+1)<<endl;
        }else{
            if(v.size()>2){
                F(i,min(a,b),max(a,b)){
                    if(v[i+1]-v[i]>=2){
                        cout<<"yes\n";
                        cout<<i<<" "<<i+1<<endl;
                        f=1;
                        break;
                    }
                }

            }
            if(!f)
                cout<<"no\n";
        }
    }

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        auto it=max_element(all(v)),it1=min_element(all(v));
        a=it-v.begin();
        b=it1-v.begin();
        if(*it-*it1>=abs(a-b)+1){
            cout<<"yes\n";
            cout<<min(b+1,a+1)<<" "<<max(a+1,b+1)<<endl;
        }else{
            if(v.size()>2){
                s=max(a,b);
                for(int j=s;j>min(a,b)+1;--j){

                F(i,min(a,b)+1,max(a,b)){
                    s=*max_element(v.begin()+i,v.begin()+j+1);
                    if(v[s]-v[i]>=s-i+1){
                        cout<<"yes\n";
                        cout<<i+1<<" "<<max(a+1,b+1)<<endl;
                        f=1;
                        break;
                    }
                }

                }

            }
            if(!f)
                cout<<"no\n";
        }
    }

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        auto it=max_element(all(v)),it1=min_element(all(v));
        a=it-v.begin();
        b=it1-v.begin();
        if(*it-*it1>=abs(a-b)+1){
            cout<<"yes\n";
            cout<<min(b+1,a+1)<<" "<<max(a+1,b+1)<<endl;
        }else{
            if(v.size()>2){
                s=max(a,b);
                F(i,min(a,b)+1,max(a,b)){
                    if(v[s]-v[i]>=s-i+1){
                        cout<<"yes\n";
                        cout<<i+1<<" "<<max(a+1,b+1)<<endl;
                        f=1;
                        break;
                    }
                }

            }
            if(!f)
                cout<<"no\n";
        }
    }

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        auto it=max_element(all(v)),it1=min_element(all(v));
        a=it-v.begin();
        b=it1-v.begin();
        if(*it-*it1>=abs(a-b)+1){
            cout<<"yes\n";
            cout<<min(b+1,a+1)<<" "<<max(a+1,b+1)<<endl;
        }else{
            if(v.size()>2){
                F(i,0,n){
                    if(v[i+1]-v[i]>=2){
                        cout<<"yes\n";
                        cout<<i<<" "<<i+1<<endl;
                        f=1;
                        break;
                    }
                }

            }
            if(!f)
                cout<<"no\n";
        }
    }

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        auto it=max_element(all(v)),it1=min_element(all(v));
        a=it-v.begin();
        b=it1-v.begin();
        if(*it-*it1>=abs(a-b)+1){
            cout<<"yes\n";
            cout<<min(b+1,a+1)<<" "<<max(a+1,b+1)<<endl;
        }else{
            //if(v.size()>2){
                F(i,0,n-1){
                    if(v[i+1]-v[i]>=2){
                        cout<<"yes\n";
                        cout<<i<<" "<<i+1<<endl;
                        f=1;
                        break;
                    }
                }

            //}
            if(!f)
                cout<<"no\n";
        }
    }

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        auto it=max_element(all(v)),it1=min_element(all(v));
        a=it-v.begin();
        b=it1-v.begin();
        if(*it-*it1>=abs(a-b)+1){
            cout<<"yes\n";
            cout<<min(b+1,a+1)<<" "<<max(a+1,b+1)<<endl;
        }else{
            if(v.size()>2){
                s=max(a,b);
                for(int j=s;j>min(a,b)+1;--j){

                F(i,min(a,b)+1,max(a,b)){
                    if(j<=i){
                        break;
                        s=-1;
                    }
                    it=max_element(v.begin()+i,v.begin()+j+1);
                    it1=min_element(v.begin()+i,v.begin()+j+1);
                    c=it1-v.begin();s=it-v.begin();
                    if(*it-*it1>=abs(s-c)+1){
                        cout<<"yes\n";
                        cout<<min(c+1,s+1)<<" "<<max(c+1,s+1)<<endl;
                        f=1;
                        break;
                    }
                }
                    if(s==-1)
                        break;
                }

            }
            if(!f)
                cout<<"no\n";
        }
    }

	return 0;
}


#include<iostream>
#include<string>
#include<string.h>
#include<cstring>
#include<math.h>
#include<iomanip>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<cctype>
#include<utility>
#include<set>
#include<map>
#include<sstream>
#include<iterator>
#include<limits>
#include<map>
#include<deque>
using namespace std;
#define pb push_back
#define F(i,a,b) for(int i=a;i<b;++i)
#define Fl(i,a,b) for(long long i=a;i<b;++i)
#define all(v) v.begin(), v.end()
#define X first;
#define Y second;
#define mp make_pair;
typedef long long ll;
typedef std::vector<int> vec;
typedef std::vector<long long> vecl;
typedef map<int,int> mii;
typedef std::pair<int,int> pii;
typedef pair<ll,ll> pll;
const int MOD = 1000000007;

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

 	int t{},T{};
 	cin>>t;T=t;
 	while(t--){
        //cout<<"------------- #"<<T-t<<endl;
        int n{},k{},a{},b{},c{},s{},f{};
        cin>>n;
        vec v(n);
        F(i,0,n){
            cin>>v[i];
        }
        F(i,0,n-1){
            if(v[i+1]-v[i]>=2){
                cout<<"yes\n";
                cout<<i<<" "<<i+1<<endl;
                f=1;
                break;
            }
        }
        if(!f)
            cout<<"no\n";
    }

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long int
#define inf std::numeric_limits<double>::infinity()
#define DECI(n) fixed<<showpoint<<setprecision(n)
#define MOD 1000000007LL
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define FORR(i,end,start) for(int i=end-1;i>=start;i--)
#define INPUT(arr,n) FOR(i,0,n)cin>>arr[i];
#define INPUT2d(arr,n,k) FOR(i,0,n)FOR(j,0,k)cin>>arr[i][j];
#define SIZE 100005
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define pb(n) push_back(n)
#define fi first
#define si second

main(){
    ll t=1;
    cin>>t;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	for(ll i=0;i<n;i++)cin>>a[i];
    	ll ind = 0;
    	for(ll i=1;i<n;i++){
    		if(a[i]<a[ind]){
    			ind = i;
    		}
    	}
    	ll f = 1;
    	for(ll i=0;i<=ind;i++){
    		if(a[i]-a[ind]>=ind-i+1){
    			f=0;
    			cout<<"YES\n";
    			cout<<i+1<<" "<<ind+1<<"\n";
    			break;
    		}
    	}
    	if(f){

    	for(ll i=ind+1;i<n;i++){
    		if(a[i]-a[ind]>=i-ind+1){
    			f=0;
    			cout<<"YES\n";
    			cout<<ind+1<<" "<<i+1<<"\n";
    			break;
    		}
    	}
    }
    	if(f)cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long int
#define inf std::numeric_limits<double>::infinity()
#define DECI(n) fixed<<showpoint<<setprecision(n)
#define MOD 1000000007LL
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define FORR(i,end,start) for(int i=end-1;i>=start;i--)
#define INPUT(arr,n) FOR(i,0,n)cin>>arr[i];
#define INPUT2d(arr,n,k) FOR(i,0,n)FOR(j,0,k)cin>>arr[i][j];
#define SIZE 100005
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define pb(n) push_back(n)
#define fi first
#define si second

main(){
    ll t=1;
    cin>>t;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	for(ll i=0;i<n;i++)cin>>a[i];
    	ll ind = 0;
    	for(ll i=1;i<n;i++){
    		if(a[i]<a[ind]){
    			ind = i;
    		}
    	}
    	vector<ll> v;
    	for(ll i=0;i<n;i++){
    		if(a[i]==a[ind]){
    			v.push_back(i);
    		}
    	}
    	ll f= 1;
    	if(v.size()==1)
    	for(ll i=0;i<n;i++){
    		if(a[i]-a[ind]>=abs(i-ind)+1){
    			cout<<"YES\n";
    			cout<<MIN(i,ind)+1<<" "<<MAX(i,ind)+1<<"\n";
    			f=0;
    			break;
    		}
    	}
    	for(ll k=0;k<v.size();k++){
    		if(k==0&&f){
    			ll i = v[0];
    			for(ll j=0;j<=v[k+1];j++){
    				if(a[j]-a[i]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k==v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=v[k-1];j<n;j++){
    				if(a[j]-a[i]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=0&&f){
    			ll i = v[k];
    			for(ll j=i;j>=v[k-1];j--){
    				if(a[j]-a[i]>=i-j+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<j+1<<" "<<i+1<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=i;j<=v[k+1];j++){
    				if(a[j]-a[i]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<i+1<<" "<<j+1<<"\n";
    					break;
    				}
    			}
    		}
    	}

    	if(f)cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long int
#define inf std::numeric_limits<double>::infinity()
#define DECI(n) fixed<<showpoint<<setprecision(n)
#define MOD 1000000007LL
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define FORR(i,end,start) for(int i=end-1;i>=start;i--)
#define INPUT(arr,n) FOR(i,0,n)cin>>arr[i];
#define INPUT2d(arr,n,k) FOR(i,0,n)FOR(j,0,k)cin>>arr[i][j];
#define SIZE 100005
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define pb(n) push_back(n)
#define fi first
#define si second

main(){
    ll t=1;
    cin>>t;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	for(ll i=0;i<n;i++)cin>>a[i];
    	ll ind = 0;
    	for(ll i=1;i<n;i++){
    		if(a[i]<a[ind]){
    			ind = i;
    		}
    	}
    	vector<ll> v;
    	for(ll i=0;i<n;i++){
    		if(a[i]==a[ind]){
    			v.push_back(i);
    		}
    	}
    	ll f= 1;
    	if(v.size()==1)
    	for(ll i=0;i<n;i++){
    		if(a[i]-a[ind]>=abs(i-ind)+1){
    			cout<<"YES\n";
    			cout<<MIN(i,ind)+1<<" "<<MAX(i,ind)+1<<"\n";
    			f=0;
    			break;
    		}
    	}
    	for(ll k=0;k<v.size();k++){
    		if(k==0&&f){
    			ll i = v[0];
    			for(ll j=0;j<=v[k+1];j++){
    				if(a[j]-a[i]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k==v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=v[k-1];j<n-1;j++){
    				if(a[j]-a[i]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=0&&f){
    			ll i = v[k];
    			for(ll j=i;j>=v[k-1];j--){
    				if(a[j]-a[i]>=i-j+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<j+1<<" "<<i+1<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=i;j<=v[k+1];j++){
    				if(a[j]-a[i]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<i+1<<" "<<j+1<<"\n";
    					break;
    				}
    			}
    		}
    	}

    	if(f)cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long int
#define inf std::numeric_limits<double>::infinity()
#define DECI(n) fixed<<showpoint<<setprecision(n)
#define MOD 1000000007LL
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define FORR(i,end,start) for(int i=end-1;i>=start;i--)
#define INPUT(arr,n) FOR(i,0,n)cin>>arr[i];
#define INPUT2d(arr,n,k) FOR(i,0,n)FOR(j,0,k)cin>>arr[i][j];
#define SIZE 100005
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define pb(n) push_back(n)
#define fi first
#define si second

main(){
    ll t=1;
    cin>>t;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	ll ind[n];
    	ll max[n];
    	for(ll i=0;i<n;i++)cin>>a[i];
    	ind[0] = 0;
    	max[0] = 0;
    	for(ll i=1;i<n;i++){
    		if(a[i]>a[ind[i-1]]){
    			ind[i] = ind[i-1];
    		}
    		else{
    			ind[i] = i;
    		}
    		if(a[i]>a[max[i-1]]){
    			max[i] = i;
    		}
    		else max[i] = max[i-1];
    	}
    	ll f = 1;
    	for(ll i=1;i<n;i++){
    		//cout<<max[i]<<" "<<ind[i]<<"\n";
    		if(abs(max[i]-ind[i]+1)<=a[max[i]]-a[ind[i]]){
    			f = 0;
    			cout<<"YES\n";
    			cout<<MIN(max[i],ind[i])+1<<" "<<MAX(max[i],ind[i])+1<<"\n";
    			break;
    		}
    	}
    	if(f){

    	ind[n-1] = 0;
    	max[n-1] = 0;
    	for(ll i=n-2;i>=0;i--){
    		if(a[i]>a[ind[i+1]]){
    			ind[i] = ind[i+1];
    		}
    		else{
    			ind[i] = i;
    		}
    		if(a[i]>a[max[i+1]]){
    			max[i] = i;
    		}
    		else max[i] = max[i+1];
    	}
    	ll f = 1;
    	for(ll i=0;i<n-1;i++){
    		//cout<<max[i]<<" "<<ind[i]<<"\n";
    		if(abs(max[i]-ind[i]+1)<=a[max[i]]-a[ind[i]]){
    			f = 0;
    			cout<<"YES\n";
    			cout<<MIN(max[i],ind[i])+1<<" "<<MAX(max[i],ind[i])+1<<"\n";
    			break;
    		}
    	}
   			 }
    	if(f==1){cout<<"NO\n";}
    }
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long int
#define inf std::numeric_limits<double>::infinity()
#define DECI(n) fixed<<showpoint<<setprecision(n)
#define MOD 1000000007LL
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define FORR(i,end,start) for(int i=end-1;i>=start;i--)
#define INPUT(arr,n) FOR(i,0,n)cin>>arr[i];
#define INPUT2d(arr,n,k) FOR(i,0,n)FOR(j,0,k)cin>>arr[i][j];
#define SIZE 100005
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define pb(n) push_back(n)
#define fi first
#define si second

main(){
    ll t=1;
    cin>>t;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	for(ll i=0;i<n;i++)cin>>a[i];
    	ll ind = 0;
    	ll  ans=-1;
    	for(ll i=1;i<n;i++){
    		if(a[i]>=a[ind]){
    			ind = i;
    		}
    		if(a[i]==0){
    		    ans = i;
    		}
    	}
    	vector<ll> v;
    	ll f= 1;
    	if(ans!=-1){
    	    cout<<"YES\n";
    	    cout<<ans+1<<" "<<ans+1<<"\n";
    	    continue;
    	}
    	for(ll i=0;i<n;i++){
    		if(a[i]==a[ind]){
    			v.push_back(i);
    		}

    	}
    	if(v.size()==1)
    	for(ll i=0;i<n;i++){
    		if(a[ind]-a[i]>=abs(i-ind)+1){
    			cout<<"YES\n";
    			cout<<MIN(i,ind)+1<<" "<<MAX(i,ind)+1<<"\n";
    			f=0;
    			break;
    		}
    	}

    	if(v.size()!=1)
    	for(ll k=0;k<v.size();k++){
    		if(k==0&&f){
    			ll i = v[0];
    			for(ll j=0;j<=v[k+1];j++){
    				if(a[i]-a[j]>=abs(j-i)+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k==v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=v[k-1];j<n;j++){
    				if(a[i]-a[j]>=abs(j-i)+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=0&&f){
    			ll i = v[k];
    			for(ll j=i;j>=v[k-1];j--){
    				if(a[i]-a[j]>=i-j+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<j+1<<" "<<i+1<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=i;j<=v[k+1];j++){
    				if(a[i]-a[j]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<i+1<<" "<<j+1<<"\n";
    					break;
    				}
    			}
    		}
    	}

    	if(f)cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long int
#define inf std::numeric_limits<double>::infinity()
#define DECI(n) fixed<<showpoint<<setprecision(n)
#define MOD 1000000007LL
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define FORR(i,end,start) for(int i=end-1;i>=start;i--)
#define INPUT(arr,n) FOR(i,0,n)cin>>arr[i];
#define INPUT2d(arr,n,k) FOR(i,0,n)FOR(j,0,k)cin>>arr[i][j];
#define SIZE 100005
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define pb(n) push_back(n)
#define fi first
#define si second

main(){
    ll t=1;
    cin>>t;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	for(ll i=0;i<n;i++)cin>>a[i];
    	ll ind = 0;
    	for(ll i=1;i<n;i++){
    		if(a[i]<a[ind]){
    			ind = i;
    		}
    	}
    	vector<ll> v;
    	for(ll i=0;i<n;i++){
    		if(a[i]==a[ind]){
    			v.push_back(i);
    		}
    	}
    	ll f= 1;
    	if(v.size()==1)
    	for(ll i=0;i<n;i++){
    		if(a[i]-a[ind]>=abs(i-ind)+1){
    			cout<<"YES\n";
    			cout<<MIN(i,ind)+1<<" "<<MAX(i,ind)+1<<"\n";
    			f=0;
    			break;
    		}
    	}
    	if(v.size()!=1)
    	for(ll k=0;k<v.size();k++){
    		if(k==0&&f){
    			ll i = v[0];
    			for(ll j=0;j<=v[k+1];j++){
    				if(a[j]-a[i]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k==v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=v[k-1];j<n;j++){
    				if(a[j]-a[i]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=0&&f){
    			ll i = v[k];
    			for(ll j=i;j>=v[k-1];j--){
    				if(a[j]-a[i]>=i-j+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<j+1<<" "<<i+1<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=i;j<=v[k+1];j++){
    				if(a[j]-a[i]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<i+1<<" "<<j+1<<"\n";
    					break;
    				}
    			}
    		}
    	}

    	if(f)cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long int
#define inf std::numeric_limits<double>::infinity()
#define DECI(n) fixed<<showpoint<<setprecision(n)
#define MOD 1000000007LL
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define FORR(i,end,start) for(int i=end-1;i>=start;i--)
#define INPUT(arr,n) FOR(i,0,n)cin>>arr[i];
#define INPUT2d(arr,n,k) FOR(i,0,n)FOR(j,0,k)cin>>arr[i][j];
#define SIZE 100005
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define pb(n) push_back(n)
#define fi first
#define si second

main(){
    ll t=1;
    cin>>t;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	ll ind[n];
    	ll max[n];
    	for(ll i=0;i<n;i++)cin>>a[i];
    	ind[0] = 0;
    	max[0] = 0;
    	for(ll i=1;i<n;i++){
    		if(a[i]>a[ind[i-1]]){
    			ind[i] = ind[i-1];
    		}
    		else{
    			ind[i] = i;
    		}
    		if(a[i]>a[max[i-1]]){
    			max[i] = i;
    		}
    		else max[i] = max[i-1];
    	}
    	ll f = 1;
    	for(ll i=1;i<n;i++){
    		//cout<<max[i]<<" "<<ind[i]<<"\n";
    		if(abs(max[i]-ind[i]+1)<=a[max[i]]-a[ind[i]]){
    			f = 0;
    			cout<<"YES\n";
    			cout<<MIN(max[i],ind[i])+1<<" "<<MAX(max[i],ind[i])+1<<"\n";
    			break;
    		}
    	}
    	if(f==1){cout<<"NO\n";}
    }
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long int
#define inf std::numeric_limits<double>::infinity()
#define DECI(n) fixed<<showpoint<<setprecision(n)
#define MOD 1000000007LL
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define FORR(i,end,start) for(int i=end-1;i>=start;i--)
#define INPUT(arr,n) FOR(i,0,n)cin>>arr[i];
#define INPUT2d(arr,n,k) FOR(i,0,n)FOR(j,0,k)cin>>arr[i][j];
#define SIZE 100005
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define pb(n) push_back(n)
#define fi first
#define si second

main(){
    ll t=1;
    cin>>t;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	for(ll i=0;i<n;i++)cin>>a[i];
    	ll ind = 0;
    	for(ll i=1;i<n;i++){
    		if(a[i]<a[ind]){
    			ind = i;
    		}
    	}
    	vector<ll> v;
    	for(ll i=0;i<n;i++){
    		if(a[i]==a[ind]){
    			v.push_back(i);
    		}
    	}
    	ll f= 1;
    	if(v.size()==1)
    	for(ll i=0;i<n;i++){
    		if(a[i]-a[ind]>=abs(i-ind)+1){
    			cout<<"YES\n";
    			cout<<MIN(i,ind)+1<<" "<<MAX(i,ind)+1<<"\n";
    			f=0;
    			break;
    		}
    	}
    	for(ll k=0;k<v.size();k++){
    		if(k!=0&&f){
    			ll i = v[k];
    			for(ll j=i;j>=v[k-1];j--){
    				if(a[j]-a[i]>=i-j+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<j+1<<" "<<i+1<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=i;j<=v[k+1];j++){
    				if(a[j]-a[i]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<i+1<<" "<<j+1<<"\n";
    					break;
    				}
    			}
    		}
    	}

    	if(f)cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long int
#define inf std::numeric_limits<double>::infinity()
#define DECI(n) fixed<<showpoint<<setprecision(n)
#define MOD 1000000007LL
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define FORR(i,end,start) for(int i=end-1;i>=start;i--)
#define INPUT(arr,n) FOR(i,0,n)cin>>arr[i];
#define INPUT2d(arr,n,k) FOR(i,0,n)FOR(j,0,k)cin>>arr[i][j];
#define SIZE 100005
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define pb(n) push_back(n)
#define fi first
#define si second

main(){
    ll t=1;
    cin>>t;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	for(ll i=0;i<n;i++)cin>>a[i];
    	ll f=1;
    	for(ll i=0;i<n-1;i++){
    		if(abs(a[i]-a[i+1])>=2){
    			cout<<"YES\n";
    			f=0;
    			cout<<i+1<<" "<<i+2<<"\n";
    			break;
    		}
    	}
    	if(f)cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long int
#define inf std::numeric_limits<double>::infinity()
#define DECI(n) fixed<<showpoint<<setprecision(n)
#define MOD 1000000007LL
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define FORR(i,end,start) for(int i=end-1;i>=start;i--)
#define INPUT(arr,n) FOR(i,0,n)cin>>arr[i];
#define INPUT2d(arr,n,k) FOR(i,0,n)FOR(j,0,k)cin>>arr[i][j];
#define SIZE 100005
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define pb(n) push_back(n)
#define fi first
#define si second

main(){
    ll t=1;
    cin>>t;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	for(ll i=0;i<n;i++)cin>>a[i];
    	ll ind = 0;
    	ll  ans=-1;
    	for(ll i=1;i<n;i++){
    		if(a[i]>=a[ind]){
    			ind = i;
    		}
    		if(a[i]==0){
    		    ans = i;
    		}
    	}
    	vector<ll> v;
    	ll f= 1;

    	for(ll i=0;i<n;i++){
    		if(a[i]==a[ind]){
    			v.push_back(i);
    		}

    	}
    	if(v.size()==1)
    	for(ll i=0;i<n;i++){
    		if(a[ind]-a[i]>=abs(i-ind)+1){
    			cout<<"YES\n";
    			cout<<MIN(i,ind)+1<<" "<<MAX(i,ind)+1<<"\n";
    			f=0;
    			break;
    		}
    	}

    	if(v.size()!=1)
    	for(ll k=0;k<v.size();k++){
    		if(k==0&&f){
    			ll i = v[0];
    			for(ll j=0;j<=v[k+1];j++){
    				if(a[i]-a[j]>=abs(j-i)+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k==v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=v[k-1];j<n;j++){
    				if(a[i]-a[j]>=abs(j-i)+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=0&&f){
    			ll i = v[k];
    			for(ll j=i;j>=v[k-1];j--){
    				if(a[i]-a[j]>=i-j+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<j+1<<" "<<i+1<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=i;j<=v[k+1];j++){
    				if(a[i]-a[j]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<i+1<<" "<<j+1<<"\n";
    					break;
    				}
    			}
    		}
    	}

    	if(f)cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define  ll long long int
#define inf std::numeric_limits<double>::infinity()
#define DECI(n) fixed<<showpoint<<setprecision(n)
#define MOD 1000000007LL
#define FOR(i,start,end) for(int i=start;i<end;i++)
#define FORR(i,end,start) for(int i=end-1;i>=start;i--)
#define INPUT(arr,n) FOR(i,0,n)cin>>arr[i];
#define INPUT2d(arr,n,k) FOR(i,0,n)FOR(j,0,k)cin>>arr[i][j];
#define SIZE 100005
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define pb(n) push_back(n)
#define fi first
#define si second

main(){
    ll t=1;
    cin>>t;
    while(t--)
    {
    	ll n;
    	cin>>n;
    	ll a[n];
    	for(ll i=0;i<n;i++)cin>>a[i];
    	ll ind = 0;
    	for(ll i=1;i<n;i++){
    		if(a[i]<a[ind]){
    			ind = i;
    		}
    	}
    	vector<ll> v;
    	for(ll i=0;i<n;i++){
    		if(a[i]==a[ind]){
    			v.push_back(i);
    		}
    	}
    	ll f= 1;
    	if(v.size()==1)
    	for(ll i=0;i<n;i++){
    		if(a[i]-a[ind]>=abs(i-ind)+1){
    			cout<<"YES\n";
    			cout<<MIN(i,ind)+1<<" "<<MAX(i,ind)+1<<"\n";
    			f=0;
    			break;
    		}
    	}

    	if(v.size()!=1)
    	for(ll k=0;k<v.size();k++){
    		if(k==0&&f){
    			ll i = v[0];
    			for(ll j=0;j<=v[k+1];j++){
    				if(a[j]-a[i]>=abs(j-i)+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k==v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=v[k-1];j<n;j++){
    				if(a[j]-a[i]>=abs(j-i)+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<MIN(i+1,j+1)<<" "<<MAX(j+1,i+1)<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=0&&f){
    			ll i = v[k];
    			for(ll j=i;j>=v[k-1];j--){
    				if(a[j]-a[i]>=i-j+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<j+1<<" "<<i+1<<"\n";
    					break;
    				}
    			}
    		}
    		if(k!=v.size()-1&&f){
    			ll i = v[k];
    			for(ll j=i;j<=v[k+1];j++){
    				if(a[j]-a[i]>=j-i+1){
    					f=0;
    					cout<<"YES\n";
    					cout<<i+1<<" "<<j+1<<"\n";
    					break;
    				}
    			}
    		}
    	}

    	if(f)cout<<"NO\n";
    }
}


#include <bits/stdc++.h>
using namespace std;
#define counting ones = __builtin_popcount
int main()
{
    int t;
    cin>>t;
    while(t--){
        int n; cin>>n;
        long long arr[n+2];
        bool flag = false;
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        for(int i=1;i<n;i++){
            if(arr[i]-arr[i-1]>=2){
                cout<< "YES"<<endl<<i<< " "<<i+1<<endl;
            flag =true;
                break;
            }
            else if(arr[i-1]-arr[i]>=2){
                cout<< "YES"<<endl<<i<< " "<<i+1<<endl;
                flag =true;
                break;
            }
        }
        if(flag==false)
            cout<< "NO"<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    while(n--){
        int x; cin>>x;
        long long arr[x+2];
        bool flag = false;
        for(int i=0;i<x;i++){
            cin>>arr[i];
        }
        for(int i=1;i<x;i++){
            if(abs(arr[i]-arr[i-1]>=2)){
                cout<< "YES"<<endl<<i<< " "<<i+1<<endl;
            flag =true;
                break;
            }
        }
        if(flag==false)
            cout<< "NO"<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define counting ones = __builtin_popcount
int main()
{
    int t;
    cin>>t;
    while(t--){
        int n; cin>>n;
        long long arr[n+2];
        bool flag = false;
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        for(int i=1;i<n;i++){
            if(arr[i]-arr[i-1]>=2){
                cout<< "YES"<<endl<<i+1<< " "<<i<<endl;
            flag =true;
                break;
            }
            else if(arr[i-1]-arr[i]>=2){
                cout<< "YES"<<endl<<i<< " "<<i+1<<endl;
                flag =true;
                break;
            }
        }
        if(flag==false)
            cout<< "NO"<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define counting ones = __builtin_popcount
int main()
{
    int t;
    cin>>t;
    while(t--){
        int n; cin>>n;
        long long arr[n+2];
        bool flag = false;
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        for(int i=1;i<n;i++){
            if(arr[i]-arr[i-1]>=2){
                cout<< "YES"<<endl<<i-1<< " "<<i<<endl;
            flag =true;
                break;
            }
            else if(arr[i-1]-arr[i]>=2){
                cout<< "YES"<<endl<<i<< " "<<i-1<<endl;
                flag =true;
                break;
            }
        }
        if(flag==false)
            cout<< "NO"<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define counting ones = __builtin_popcount
int main()
{
    int t;
    cin>>t;
    while(t--){
        int n; cin>>n;
        long long arr[n+2];
        bool flag = false;
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        for(int i=1;i<n;i++){
            if(arr[i]-arr[i-1]>=2){
                cout<< "YES"<<endl<<i<< " "<<i-1<<endl;
            flag =true;
                break;
            }
            else if(arr[i-1]-arr[i]>=2){
                cout<< "YES"<<endl<<i-1<< " "<<i<<endl;
                flag =true;
                break;
            }
        }
        if(flag==false)
            cout<< "NO"<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define counting ones = __builtin_popcount
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,cntr=0,indexsmall,indexbig;
        cin>>n;
        int arr[n+2];
        bool flag =false;
        for(int i=0; i<n; i++)
        {
                cin>>arr[i];
            if (i==0)
                cntr++;
            else
            {
                cntr++;
                if (abs(arr[i]-arr[0])>cntr)
                {
                    flag =true;
                    indexsmall =1;
                    indexbig=i+1;
                }
                else
                    continue;
            }
        }
        if(flag ==false){
            int cntr2=0,indexbig2,indexsmall2;
            bool flag2=false;
            for(int i=n-1;i>=0;i--){
                if(i==0) cntr2++;
                else{
                    cntr2++;
                    if(abs(arr[i]-arr[n-1])>cntr2){flag2 =true;
                    indexsmall2 =i+1;
                    indexbig2=n;}
                    else
                    continue;
                }
            }
            if(flag2==false) cout<< "NO"<<endl;
            else {cout << "YES"<<endl; cout<< indexsmall2<< " " <<indexbig2<<endl;}
        }
        else {cout<< "YES"<< endl;
        cout << indexsmall << " "<<indexbig<<endl;}
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define counting ones = __builtin_popcount
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        long long arr[n+3];
        map<long long,long long>mp;
        for(int i=0; i<n; i++)
        {
            cin>>arr[i];
            mp[arr[i]]=i+1;
        }
        bool flag = false;
        for(int i=0; i<n; i++)
        {
            int s=0,e=n-1,mid,big=0,small=0;
            while(s<=e)
            {
                mid=(s+e)/2;
                if(abs(arr[mid]-arr[i])>abs(mp[mid]-mp[i])+1)
                {
                    big = mp[arr[mid]];
                    small = mp[arr[i]];
                    break;
                }
                else
                    s=mid+1;
            }
            if(small==0&& big==0)
            {
                int s2=0,e2=n-1,mid2,big2=0,small2=0;
                while(s2<=e2)
                {
                    mid2=(s2+e2)/2;
                    if(abs(arr[mid2]-arr[i])>abs(mp[mid2]-mp[i])+1)
                    {
                        big2 = mp[arr[i]];
                        small2 = mp[arr[mid2]];
                        break;
                    }
                    else
                        e2=mid2-1;
                }
                if(big2==0&&small2==0)
                    continue;
                else{
                    cout<< "YES"<<endl<< small2 << " "<< big2<<endl; flag -true ; break;}
            }
            else{
                cout<< "YES"<<endl<<small  << " "<< big<<endl; flag =true; break;}
        }
        if(flag==false) cout<< "NO"<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define counting ones = __builtin_popcount
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        long long arr[n+3];
        map<long long,long long>mp;
        for(int i=0; i<n; i++)
        {
            cin>>arr[i];
            mp[arr[i]]=i+1;
        }
        bool flag = false;
        for(int i=0; i<n; i++)
        {
            int s=0,e=n-1,mid,big=0,small=0;
            while(s<=e)
            {
                mid=(s+e)/2;
                if(abs(arr[mid]-arr[i])>abs(mp[arr[mid]]-mp[arr[i]])+1)
                {
                    big = mp[arr[mid]];
                    small = mp[arr[i]];
                    break;
                }
                else
                    s=mid+1;
            }
            if(small==0&& big==0)
            {
                int s2=0,e2=n-1,mid2,big2=0,small2=0;
                while(s2<=e2)
                {
                    mid2=(s2+e2)/2;
                    if(abs(arr[mid2]-arr[i])>abs(mp[arr[mid2]]-mp[arr[i]])+1)
                    {
                        big2 = mp[arr[i]];
                        small2 = mp[arr[mid2]];
                        break;
                    }
                    else
                        e2=mid2-1;
                }
                if(big2==0&&small2==0)
                    continue;
                else{
                    cout<< "YES"<<endl<< small2 << " "<< big2<<endl; flag -true ; break;}
            }
            else{
                cout<< "YES"<<endl<<small  << " "<< big<<endl; flag =true; break;}
        }
        if(flag==false) cout<< "NO"<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define counting ones = __builtin_popcount
int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n,cntr=0,indexsmall,indexbig;
        cin>>n;
        int arr[n+2];
        bool flag =false;
        for(int i=0; i<n; i++)
        {
                cin>>arr[i];
            if (i==0)
                cntr++;
            else
            {
                cntr++;
                if (abs(arr[i]-arr[0])>cntr)
                {
                    flag =true;
                    indexsmall =1;
                    indexbig=i+1;
                }
                else
                    continue;
            }
        }
        if(flag ==false){
            int cntr2=0,indexbig2,indexsmall2;
            bool flag2=false;
            for(int i=n-1;i>=0;i--){
                if(i==0) cntr2++;
                else{
                    cntr2++;
                    if(abs(arr[i]-arr[n-1])>cntr2){flag2 =true;
                    indexsmall =i+1;
                    indexbig=n;}
                    else
                    continue;
                }
            }
            if(flag2==false) cout<< "NO"<<endl;
            else {cout << "YES"<<endl; cout<< indexsmall2<< " " <<indexbig2<<endl;}
        }
        else {cout<< "YES"<< endl;
        cout << indexsmall << " "<<indexbig<<endl;}
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

void solve (vector <int> a, int n)
{
    bool o = true;
        for (int i = 0; i <= n; i++)
        {
            for (int j = i + 1; j <= n; j++)
            {
                if (*max_element(a.begin() + i, a.begin() + j) - *min_element(a.begin() + i, a.begin() + j) >= abs(j - i))
                {
                    cout << "YES" << endl << min(i, j) + 1 << " " << max(i, j) << endl;
                    o = false;
                    return;
                }
                //cout << "c: " << *max_element(a.begin() + i, a.begin() + j) << " " << *min_element(a.begin() + i, a.begin() + j) << endl;
            }
        }
        if (o)
            cout << "NO" << endl;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
    int T; cin >> T;
    while (T--)
    {
        int n;
        cin >> n;
        vector <int> a;
        for (int i = 0; i < n; i++)
        {
            int t; cin >> t;
            a.push_back(t);
        }
        solve(a, n);
    }
    return 0;
}


#include <bits/stdc++.h>
#define max_(x) *max_element(x.begin(), x.end())
#define min_(x) *min_element(x.begin(), x.end())

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
    int T; cin >> T;
    while (T--)
    {
        int n;
        cin >> n;
        vector <int> a;
        for (int i = 0; i < n; i++)
        {
            int t; cin >> t;
            a.push_back(t);
        }
        if (max_(a) - min_(a) >= n)
        {
            cout << "YES" << endl;
            int ind_min = 1;
            int ind_max = 1;
            int temp_min = a.at(0);
            int temp_max = a.at(0);
            for (int i = 0; i < n; i++)
            {
                if (temp_max < a.at(i))
                {
                    ind_max = i + 1;
                    temp_max = a.at(i);
                }
                if (temp_min > a.at(i))
                {
                    ind_min = i + 1;
                    temp_min = a.at(i);
                }
            }
            cout << min(ind_min, ind_max) << " " << max(ind_max, ind_min) << endl;
        }
        else
            cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#define max_(x) *max_element(x.begin(), x.end())
#define min_(x) *min_element(x.begin(), x.end())

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
    int T; cin >> T;
    while (T--)
    {
        int n;
        cin >> n;
        vector <int> a;
        for (int i = 0; i < n; i++)
        {
            int t; cin >> t;
            a.push_back(t);
        }
        if (max_(a) - min_(a) >= n)
        {
            cout << "YES" << endl;
            cout << "1 " << n << endl;
        }
        else
            cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int T;
    cin >> T;
    while (T--)
    {
        int n;
        cin >> n;
        vector <int> a (n);
        for (int j = 0; j < n; j++)
            cin >> a[j];
        bool f = false;
        for (int j = 1; j < n; j++)
            if (abs(a[j] - a[j - 1]) > 1)
            {
                cout << "YES\n" << j << " " << j + 1 << "\n";
                f = true;
                break;
            }
        if (!f)
            cout << "NO\n";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

void solve (vector <int> a, int n)
{
    bool o = true;
        for (int i = 0; i < n; i++)
        {
            for (int j = i + 1; j < n; j++)
            {
                if (*max_element(a.begin() + i, a.begin() + j) - *min_element(a.begin() + i, a.begin() + j) >= abs(j - i))
                {
                    cout << "YES" << endl << min(i, j) + 1 << " " << max(i, j) << endl;
                    o = false;
                    return;
                }
                //cout << "c: " << *max_element(a.begin() + i, a.begin() + j) << " " << *min_element(a.begin() + i, a.begin() + j) << endl;
            }
        }
        if (o)
            cout << "NO" << endl;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
    int T; cin >> T;
    while (T--)
    {
        int n;
        cin >> n;
        vector <int> a;
        for (int i = 0; i < n; i++)
        {
            int t; cin >> t;
            a.push_back(t);
        }
        solve(a, n);
    }
    return 0;
}


#include <bits/stdc++.h>
#define max(x) *max_element(x.begin(), x.end())
#define min(x) *min_element(x.begin(), x.end())

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
    int T; cin >> T;
    while (T--)
    {
        int n;
        cin >> n;
        vector <int> a;
        for (int i = 0; i < n; i++)
        {
            int t; cin >> t;
            a.push_back(t);
        }
        if (max(a) - min(a) >= n)
        {
            cout << "YES" << endl;
            int ind_min = 0;
            int ind_max = 0;
            int temp_min = a.at(0);
            int temp_max = a.at(0);
            for (int i = 0; i < n; i++)
            {
                if (temp_max < a.at(i))
                {
                    ind_max = i + 1;
                    temp_max = a.at(i);
                }
                if (temp_min > a.at(i))
                {
                    ind_min = i + 1;
                    temp_min = a.at(i);
                }
            }
            cout << ind_min << " " << ind_max << endl;
        }
        else
            cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

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

void solve (vector <int> a, int n)
{
    int ind_min = distance(a.begin(), min_element(a.begin(), a.end()));
    for (int i = ind_min + 1; i < n; i++)
    {
        if (*max_element(a.begin() + ind_min, a.begin() + i) - a.at(ind_min) >= abs(ind_min - i))
        {
            cout << "YES" << endl << min(ind_min, i) + 1 << " " << max(ind_min, i) + 1 << endl;
            return;
        }
    }
    for (int i = 0; i < ind_min; i++)
        if (*max_element(a.begin() + i, a.begin() + ind_min) - a.at(ind_min) >= abs(ind_min - i))
        {
            cout << "YES" << endl << min(ind_min, i) + 1 << " " << max(ind_min, i) + 1 << endl;
            return;
        }
    cout << "NO" << endl;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
    int T; cin >> T;
    while (T--)
    {
        int n;
        cin >> n;
        vector <int> a;
        for (int i = 0; i < n; i++)
        {
            int t; cin >> t;
            a.push_back(t);
        }
        solve(a, n);
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
    int T; cin >> T;
    while (T--)
    {
        int n;
        cin >> n;
        vector <int> a;
        for (int i = 0; i < n; i++)
        {
            int t; cin >> t;
            a.push_back(t);
        }
        sort(a.begin(), a.end());
        if (a.at(n - 1) - a.at(0) >= n)
        {
            cout << "YES" << endl;
            cout << "1 " << n << endl;
        }
        else
            cout << "NO" << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#define max_(x) *max_element(x.begin(), x.end())
#define min_(x) *min_element(x.begin(), x.end())

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
    int T; cin >> T;
    while (T--)
    {
        int n;
        cin >> n;
        vector <int> a;
        for (int i = 0; i < n; i++)
        {
            int t; cin >> t;
            a.push_back(t);
        }
        if (max_(a) - min_(a) >= n)
        {
            cout << "YES" << endl;
            int ind_min = 0;
            int ind_max = 0;
            int temp_min = a.at(0);
            int temp_max = a.at(0);
            for (int i = 0; i < n; i++)
            {
                if (temp_max < a.at(i))
                {
                    ind_max = i + 1;
                    temp_max = a.at(i);
                }
                if (temp_min > a.at(i))
                {
                    ind_min = i + 1;
                    temp_min = a.at(i);
                }
            }
            cout << min(ind_min, ind_max) << " " << max(ind_max, ind_min) << endl;
        }
        else
            cout << "NO" << endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int t;
int n, k1, k2;
int a[200], b[200];
vector<int> ans;
int main() {
    cin >> t;
    while(t--) {
        int minn = 2e9;
        int maxx = 0;
        int maxpos = -1;
        int minpos = -1;
        cin >> n;
        for (int i = 0; i < n; ++i) {
            cin >> a[i];
            if (minn > a[i]) {
                minn = a[i];
                minpos = i;
            }
            if (maxx < a[i]) {
                maxx = a[i];
                maxpos = i;
            }
        }
        if (maxx - minn >= n) {
            puts("YES");
            cout << minpos << " " << maxpos << endl;
        } else {
            puts("NO");
        }
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int t;
int n, k1, k2;
int a[200], b[200];
vector<int> ans;
int main() {
    cin >> t;
    while(t--) {
        int minn = 2e9;
        int maxx = -1;
        int maxpos = -1;
        int minpos = -1;
        cin >> n;
        for (int i = 1; i <= n; ++i) {
            cin >> a[i];
            if (minn > a[i]) {
                minn = a[i];
                minpos = i;
            }
            if (maxx < a[i]) {
                maxx = a[i];
                maxpos = i;
            }
        }
        if (maxx - minn >= n) {
            puts("YES");
            if (minpos < maxpos) {
                cout << minpos << " " << maxpos << endl;
            } else {
                cout << maxpos << " " << minpos << endl;
            }

        } else {
            puts("NO");
        }
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int t;
int n;
struct num {
    int p;
    int v;
    int c;
} a[200];

bool cmp (num a, num b) {
    if (a.c == b.c) return a.p < b.p;
    return a.c < b.c;
}

int main() {
    cin >> t;
    while(t--) {
        ll minn = 2e11;
        ll maxx = -2e11;
        int maxpos = -1;
        int minpos = -1;
        cin >> n;
        for (int i = 1; i <= n; ++i) {
            cin >> a[i].v;
            a[i].p = i;
            a[i].c = a[i].v - a[i].p;
        }
        sort(a + 1, a + n + 1, cmp);
        //for (int i = 1; i <= n; ++i) cout << a[i].v << ' ';cout << endl;
        //for (int i = 1; i <= n; ++i) cout << a[i].p << ' ';cout << endl;
        //for (int i = 1; i <= n; ++i) cout << a[i].c << ' ';cout << endl;
        if (a[n].c - a[1].c > 0 && a[n].p > a[1].p) {
            puts("YES");
            maxpos = a[n].p;
            minpos = a[1].p;
            if (minpos < maxpos) {
                cout << minpos << " " << maxpos << endl;
            } else {
                cout << maxpos << " " << minpos << endl;
            }

        } else {
            puts("NO");
        }
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int t;
int n;
struct num {
    int p;
    int v;
    int c;
} a[200];

int main() {
    cin >> t;
    while(t--) {
        bool ok = false;
        int minn, maxx;
        int minpos, maxpos;
        cin >> n;
        for (int i = 1; i <= n; ++i) {
            cin >> a[i].c;
            a[i].p = i;
        }
        if (a[1].c < a[2].c) {
            minn = a[1].c;
            maxx = a[2].c;
            minpos = 1;
            maxpos = 2;
        } else {
            minn = a[2].c;
            maxx = a[1].c;
            minpos = 2;
            maxpos = 1;
        }
        if (abs(a[maxpos].c - a[minpos].c) > abs(maxpos - minpos)) {
            puts("YES");
            ok = true;
            if (minpos < maxpos) {
                cout << minpos << " " << maxpos << endl;
            } else {
                cout << maxpos << " " << minpos << endl;
            }
        } else {
            for (int i = 3; i <= n; ++i) {
                if (ok) break;
                if (a[i].c < minn) {
                    minn = a[i].c;
                    minpos = a[i].p;
                    if (abs(a[maxpos].c - a[minpos].c) > abs(maxpos - minpos)) {
                        puts("YES");
                        ok = true;
                        if (minpos < maxpos) {
                            cout << minpos << " " << maxpos << endl;
                        } else {
                            cout << maxpos << " " << minpos << endl;
                        }
                    }
                } else if (a[i].c == minn) {
                    if (abs(maxpos - minpos) > abs(maxpos - a[i].p)) {
                        minn = a[i].c;
                        minpos = a[i].p;
                        if (abs(a[maxpos].c - a[minpos].c) > abs(maxpos - minpos)) {
                            puts("YES");
                            ok = true;
                            if (minpos < maxpos) {
                                cout << minpos << " " << maxpos << endl;
                            } else {
                                cout << maxpos << " " << minpos << endl;
                            }
                        }
                    }
                }
                if (a[i].c > maxx) {
                    maxx = a[i].c;
                    maxpos = a[i].p;
                    if (abs(a[maxpos].c - a[minpos].c) > abs(maxpos - minpos)) {
                        puts("YES");
                        ok = true;
                        if (minpos < maxpos) {
                            cout << minpos << " " << maxpos << endl;
                        } else {
                            cout << maxpos << " " << minpos << endl;
                        }
                    }
                } else if (a[i].c == maxx) {
                    if (abs(maxpos - minpos) > abs(minpos - a[i].p)) {
                        maxx = a[i].c;
                        maxpos = a[i].p;
                        if (abs(a[maxpos].c - a[minpos].c) > abs(maxpos - minpos)) {
                            puts("YES");
                            ok = true;
                            if (minpos < maxpos) {
                                cout << minpos << " " << maxpos << endl;
                            } else {
                                cout << maxpos << " " << minpos << endl;
                            }
                        }
                    }
                }
            }
            if (!ok) {
                puts("NO");
            }
        }

        // for (int i = 1; i <= n; ++i) cout << a[i].v << ' ';cout << endl;
        // for (int i = 1; i <= n; ++i) cout << a[i].p << ' ';cout << endl;
        // for (int i = 1; i <= n; ++i) cout << a[i].c << ' ';cout << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int t;
int n;
int a[20000];

int main() {
    cin >> t;
    while(t--) {
        bool ok = false;
        int minn, maxx;
        int minpos, maxpos;
        cin >> n;
        for (int i = 1; i <= n; ++i) {
            cin >> a[i];
        }
        for (int i = 1; i <= n - 1; ++i) {
            if (abs(a[i] - a[i + 1]) >= 2) {
                puts("YES");
                cout << i << " " << i + 1 << endl;
                ok = true;
                break;
            }
        }

        if (!ok) {
            puts("NO");
        }

        // for (int i = 1; i <= n; ++i) cout << a[i].v << ' ';cout << endl;
        // for (int i = 1; i <= n; ++i) cout << a[i].p << ' ';cout << endl;
        // for (int i = 1; i <= n; ++i) cout << a[i].c << ' ';cout << endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int t;
int n, k1, k2;
int a[200], b[200];
vector<int> ans;
int main() {
    cin >> t;
    while(t--) {
        int minn = 2e9;
        int maxx = 0;
        int maxpos = -1;
        int minpos = -1;
        cin >> n;
        for (int i = 1; i <= n; ++i) {
            cin >> a[i];
            if (minn > a[i]) {
                minn = a[i];
                minpos = i;
            }
            if (maxx < a[i]) {
                maxx = a[i];
                maxpos = i;
            }
        }
        if (maxx - minn >= n) {
            puts("YES");
            if (minpos < maxpos) {
                cout << minpos << " " << maxpos << endl;
            } else {
                cout << maxpos << " " << minpos << endl;
            }

        } else {
            puts("NO");
        }
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int t;
int n;
struct num {
    int p;
    int v;
    int c;
} a[200];

bool cmp (num a, num b) {
    return a.c < b.c;
}

int main() {
    cin >> t;
    while(t--) {
        ll minn = 2e11;
        ll maxx = -2e11;
        int maxpos = -1;
        int minpos = -1;
        cin >> n;
        for (int i = 1; i <= n; ++i) {
            cin >> a[i].v;
            a[i].p = i;
            a[i].c = a[i].v - a[i].p;
        }
        sort(a + 1, a + n + 1, cmp);
        if (a[n].c - a[1].c > 0) {
            puts("YES");
            maxpos = a[n].p;
            minpos = a[1].p;
            if (minpos < maxpos) {
                cout << minpos << " " << maxpos << endl;
            } else {
                cout << maxpos << " " << minpos << endl;
            }

        } else {
            puts("NO");
        }
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int t;
int n;
int a[2000200];

int main() {
    cin >> t;
    while(t--) {
        bool ok = false;
        int minn, maxx;
        int minpos, maxpos;
        cin >> n;
        for (int i = 1; i <= n; ++i) {
            cin >> a[i];
        }
        for (int i = 1; i <= n - 1; ++i) {
            if (abs(a[i] - a[i + 1]) >= 2) {
                puts("YES");
                cout << i << " " << i + 1 << endl;
                ok = true;
                break;
            }
        }

        if (!ok) {
            puts("NO");
        }

        // for (int i = 1; i <= n; ++i) cout << a[i].v << ' ';cout << endl;
        // for (int i = 1; i <= n; ++i) cout << a[i].p << ' ';cout << endl;
        // for (int i = 1; i <= n; ++i) cout << a[i].c << ' ';cout << endl;
    }

    return 0;
}