#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,co=0,co1=0,co2=0,arr[10001]={0},sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000000,mi1=100000000000000,mi2=100000000000000,mi3=100000000000000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    vector<long long>v;
    vector<long long>v1;
    vector<string>vs;
    vector<string>vs1;
    //vector<pair<int,int> >v;
    set<long long>s;
    set<long long>s1;
    map< long long,long long > mp;
    //int x[]={1,-1,1,-1,2,2,-2,-2};
    //int y[]={2,2,-2,-2,1,-1,1,-1};
    int x[]={1,0,0,-1};
    int y[]={0,1,-1,0};
    cin>>a>>b;
    for(int i=1;i<=b; i++)
    {
        cin>>c>>d;
        s.insert(c);
        s1.insert(d);
        e=((s.size()*a)+(s1.size()*a)-(s.size()*s1.size());
        cout<<(a*a)-e)<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,co=0,co1=0,co2=0,arr[10001]={0},sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000000,mi1=100000000000000,mi2=100000000000000,mi3=100000000000000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    vector<long long>v;
    vector<long long>v1;
    vector<string>vs;
    vector<string>vs1;
    //vector<pair<int,int> >v;
    set<long long>s;
    set<long long>s1;
    map< long long,long long > mp;
    //int x[]={1,-1,1,-1,2,2,-2,-2};
    //int y[]={2,2,-2,-2,1,-1,1,-1};
    int x[]={1,0,0,-1};
    int y[]={0,1,-1,0};
    cin>>a>>b;
    for(int i=1;i<=b; i++)
    {
        cin>>c>>d;
        s.insert(c);
        s1.insert(d);
        e=((s.size()*a)+(s1.size()*a)-(s.size()*s1.size()));
        f=a*a;
        if((f-e)<0) cout<<0<<" ";
        else cout<<f-e<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,co=0,co1=0,co2=0,arr[10001]={0},sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000000,mi1=100000000000000,mi2=100000000000000,mi3=100000000000000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    vector<long long>v;
    vector<long long>v1;
    vector<string>vs;
    vector<string>vs1;
    //vector<pair<int,int> >v;
    set<long long>s;
    set<long long>s1;
    map< long long,long long > mp;
    //int x[]={1,-1,1,-1,2,2,-2,-2};
    //int y[]={2,2,-2,-2,1,-1,1,-1};
    int x[]={1,0,0,-1};
    int y[]={0,1,-1,0};
    cin>>a>>b;
    for(int i=1;i<=b; i++)
    {
        cin>>c>>d;
        s.insert(c);
        s1.insert(d);
        cout<<(a*a)-((s.size()*a)+(s1.size()*b)-(s.size()*s1.size()))<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,co=0,co1=0,co2=0,arr[10001]={0},sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000000,mi1=100000000000000,mi2=100000000000000,mi3=100000000000000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    vector<long long>v;
    vector<long long>v1;
    vector<string>vs;
    vector<string>vs1;
    //vector<pair<int,int> >v;
    set<long long>s;
    set<long long>s1;
    map< long long,long long > mp;
    //int x[]={1,-1,1,-1,2,2,-2,-2};
    //int y[]={2,2,-2,-2,1,-1,1,-1};
    int x[]={1,0,0,-1};
    int y[]={0,1,-1,0};
    cin>>a>>b;
    for(int i=1;i<=b; i++)
    {
        cin>>c>>d;
        s.insert(c);
        s1.insert(d);
        e=((s.size()*a)+(s1.size()*a)-(s.size()*s1.size()));
        f=a*a;
        if((f-e)<0) cout<<f<<" ";
        else cout<<f-e<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,co=0,co1=0,co2=0,arr[10001]={0},sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000000,mi1=100000000000000,mi2=100000000000000,mi3=100000000000000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    vector<long long>v;
    vector<long long>v1;
    vector<string>vs;
    vector<string>vs1;
    //vector<pair<int,int> >v;
    set<long long>s;
    set<long long>s1;
    map< long long,long long > mp;
    //int x[]={1,-1,1,-1,2,2,-2,-2};
    //int y[]={2,2,-2,-2,1,-1,1,-1};
    int x[]={1,0,0,-1};
    int y[]={0,1,-1,0};
    cin>>a>>b;
    for(int i=1;i<=b; i++)
    {
        cin>>c>>d;
        s.insert(c);
        s1.insert(d);
        e=((s.size()*a)+(s1.size()*a)-(s.size()*s1.size()));
        f=a*a;
        cout<<abs(f-e)<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,co=0,co1=0,co2=0,arr[10001]={0},sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000000,mi1=100000000000000,mi2=100000000000000,mi3=100000000000000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    vector<long long>v;
    vector<long long>v1;
    vector<string>vs;
    vector<string>vs1;
    //vector<pair<int,int> >v;
    set<long long>s;
    set<long long>s1;
    map< long long,long long > mp;
    //int x[]={1,-1,1,-1,2,2,-2,-2};
    //int y[]={2,2,-2,-2,1,-1,1,-1};
    int x[]={1,0,0,-1};
    int y[]={0,1,-1,0};
    cin>>a>>b;
    for(int i=1;i<=b; i++)
    {
        cin>>c>>d;
        s.insert(c);
        s1.insert(d);
        e=((s.size()*a)+(s1.size()*a)-(s.size()*s1.size()));
        f=a*a;
        if((f-e)<0) cout<<e<<" ";
        else cout<<f-e<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,co=0,co1=0,co2=0,arr[10001]={0},sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000000,mi1=100000000000000,mi2=100000000000000,mi3=100000000000000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    vector<long long>v;
    vector<long long>v1;
    vector<string>vs;
    vector<string>vs1;
    //vector<pair<int,int> >v;
    set<long long>s;
    set<long long>s1;
    map< long long,long long > mp;
    //int x[]={1,-1,1,-1,2,2,-2,-2};
    //int y[]={2,2,-2,-2,1,-1,1,-1};
    int x[]={1,0,0,-1};
    int y[]={0,1,-1,0};
    cin>>a>>b;
    for(int i=1;i<=b; i++)
    {
        cin>>c>>d;
        s.insert(c);
        s1.insert(d);
        cout<<(a*a)-((s.size()*a)+(s1.size()*a)-(s.size()*s1.size()))<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,co=0,co1=0,co2=0,arr[10001]={0},sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000000,mi1=100000000000000,mi2=100000000000000,mi3=100000000000000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    vector<long long>v;
    vector<long long>v1;
    vector<string>vs;
    vector<string>vs1;
    //vector<pair<int,int> >v;
    set<long long>s;
    set<long long>s1;
    map< long long,long long > mp;
    //int x[]={1,-1,1,-1,2,2,-2,-2};
    //int y[]={2,2,-2,-2,1,-1,1,-1};
    int x[]={1,0,0,-1};
    int y[]={0,1,-1,0};
    cin>>a>>b;
    for(int i=1;i<=b; i++)
    {
        cin>>c>>d;
        s.insert(c);
        s1.insert(d);
        e=((s.size()*a)+(s1.size()*a)-(s.size()*s1.size()));
        cout<<(a*a)-e<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    IOS;
    long long a,b,c,d,e,g,h,k,l,m,n,t,f,f1=0,flag=0,co=0,co1=0,co2=0,arr[10001]={0},sum=0,sum1=0,ma=0,ma1=0,ma2=0,mi=100000000000000,mi1=100000000000000,mi2=100000000000000,mi3=100000000000000;
    long long co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1;
    double pi=2 * acos (0.0);
    string str,str1,str2;
    char ch;
    //set<long long>::iterator it;
    vector<long long>v;
    vector<long long>v1;
    vector<string>vs;
    vector<string>vs1;
    //vector<pair<int,int> >v;
    set<long long>s;
    set<long long>s1;
    map< long long,long long > mp;
    //int x[]={1,-1,1,-1,2,2,-2,-2};
    //int y[]={2,2,-2,-2,1,-1,1,-1};
    int x[]={1,0,0,-1};
    int y[]={0,1,-1,0};
    cin>>a>>b;
    for(int i=1;i<=b; i++)
    {
        cin>>c>>d;
        s.insert(c);
        s1.insert(d);
        e=((s.size()*a)+(s1.size()*a)-(s.size()*s1.size()));
        f=a*a;
        if((f-e)<0) cout<<e-f<<" ";
        else cout<<f-e<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#define pb push_back
#define mpr make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ll long long
#define ld long double
#define fi first
#define se second
#define all(arr) arr.begin(), arr.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fo(i, l, r) for (int i = l; i <= r; i++)
#define INF 1000000001
#define inf1 1000000000000000001
#define MOD 1000000007
#define mod 1000000007
#define pie 3.14159265358979323846264338327950L
#define N 200009
#define M 1e6+9
#define mid(l, r) l + (r - l) / 2
#define vec vector<int>
#define vecl vector<ll>
#define umap unordered_map<ll,ll>
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define endl "\n"
#define int long long
using namespace std;

int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}
ll lcm(ll a, ll b) { return (a*b)/ gcd(a,b);}

void test_case() {

    int n;
    cin>>n;

    int m;
    cin>>m;

    set<int> X,Y;

    int ans = n*n;

    for(int i=0; i<m; i++) {
        int x, y;
        cin>>x>>y;

        X.insert(x);
        Y.insert(y);

        int cnt = X.size()*n + Y.size()*n - X.size()*Y.size();
        int ans = n*n - cnt;
        cout<<ans<<" ";
    }

}

signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout<<fixed<<setprecision(20);

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

    int t = 1;
    // cin >> t;
    while(t--)
    {
        test_case();
    }
}


#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#define pb push_back
#define mpr make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ll long long
#define ld long double
#define fi first
#define se second
#define all(arr) arr.begin(), arr.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fo(i, l, r) for (int i = l; i <= r; i++)
#define INF 1000000001
#define inf1 1000000000000000001
#define MOD 1000000007
#define mod 998244353
#define pie 3.14159265358979323846264338327950L
#define N 200009
#define M 2000009
#define mid(l, r) l + (r - l) / 2
#define vec vector<int>
#define umap unordered_map<int, int>
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define endl "\n"
#define int long long
using namespace std;

int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}
ll lcm(ll a, ll b) { return (a*b)/ gcd(a,b);}

// map<pii,int >dp;
// set< pair<int,int> > st;
// int dfs(pii u) {
//     int x = u.first+1;
//     int y = u.second + 1;
//     int cnt = 1;
//     pii temp = mpr(x,y);
//     if(st.find(temp) != st.end()) {
//         cnt+=dfs(temp);
//     }
//     return cnt;
// }

// void fun(pii u, int val) {
//   // cout<<u.first<<" "<<u.second<<" ";
//   int x = u.first+1;
//     int y = u.second + 1;
//     dp[u] = val;
//     pii temp = mpr(x,y);
//     dp[temp] = val;
//     if(st.find(temp) != st.end()) {
//         fun(temp,val);
//     }
// }

void test_case() {

    int n;
    cin>>n;

    int m;
    cin>>m;

    set<int> X,Y;

    int ans = n*n;

    for(int i=0; i<m; i++) {
        int x, y;
        cin>>x>>y;

        X.insert(x);
        Y.insert(y);

        int cnt = X.size()*n + Y.size()*n - X.size()*Y.size();
        int ans = n*n - cnt;
        cout<<ans<<" ";
    }

}

signed main ()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout << fixed << setprecision(20);

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

    int t = 1;
    //cin >> t;
    while (t--)
    {
        test_case();
    }
}


#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#define pb push_back
#define mpr make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ll long long
#define ld long double
#define fi first
#define se second
#define all(arr) arr.begin(), arr.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fo(i, l, r) for (int i = l; i <= r; i++)
#define INF 1000000001
#define inf1 1000000000000000001
#define MOD 1000000007
#define mod 998244353
#define pie 3.14159265358979323846264338327950L
#define N 200009
#define M 2000009
#define mid(l, r) l + (r - l) / 2
#define vec vector<int>
#define umap unordered_map<int, int>
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define endl "\n"
#define int long long
using namespace std;

int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}
ll lcm(ll a, ll b) { return (a*b)/ gcd(a,b);}

// map<pii,int >dp;
// set< pair<int,int> > st;
// int dfs(pii u) {
//     int x = u.first+1;
//     int y = u.second + 1;
//     int cnt = 1;
//     pii temp = mpr(x,y);
//     if(st.find(temp) != st.end()) {
//         cnt+=dfs(temp);
//     }
//     return cnt;
// }

// void fun(pii u, int val) {
//   // cout<<u.first<<" "<<u.second<<" ";
//   int x = u.first+1;
//     int y = u.second + 1;
//     dp[u] = val;
//     pii temp = mpr(x,y);
//     dp[temp] = val;
//     if(st.find(temp) != st.end()) {
//         fun(temp,val);
//     }
// }

void test_case() {

    int n;
    cin>>n;

    int m;
    cin>>m;

    set<int> X,Y;

    int ans = n*n;

    for(int i=0; i<m; i++) {
        int x, y;
        cin>>x>>y;

        X.insert(x);
        Y.insert(y);

        int l = X.size();
        int r = Y.size();

        int cnt = l*n + r*n - l*r;
        int ans = n*n - cnt;
        cout<<ans<<" ";
    }

}

signed main ()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout << fixed << setprecision(20);

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

    int t = 1;
    //cin >> t;
    while (t--)
    {
        test_case();
    }
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	int n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << atk-X.size()*n-Y.size()*n+X.size()*Y.size() << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		tint su = tint(X.size()*n)+tint(Y.size()*n)-tint(X.size()*Y.size());
		cout << 1LL*atk-1LL*su << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);
#define sz(x) (int)(x).size()

typedef long long tint;

using namespace std;

int main(){
    NACHO;
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << atk-(n*sz(Y)+n*sz(X)-sz(X)*sz(Y)) << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		tint su = X.size()*n+Y.size()*n-X.size()*Y.size();
		cout << atk-su << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);
#define sz(x) (int)(x).size()

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << atk-(n*sz(Y)+n*sz(X)-tint(sz(X)*sz(Y))) << endl;
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<tint> X, Y;
	forn(i, m){
		tint x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << atk-tint(X.size()*n)-tint(Y.size()*n)+tint(X.size()*Y.size()) << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);
#define sz(x) (int)(x).size()

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << atk-(n*sz(Y)-n*sz(X)+sz(X)*sz(Y)) << endl;
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef unsigned long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		tint su = tint(X.size()*n)+tint(Y.size()*n)-tint(X.size()*Y.size());
		cout << 1LL*atk-1LL*su << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<tint> X, Y;
	forn(i, m){
		tint x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		tint su = tint(X.size()*n)+tint(Y.size()*n)-tint(X.size()*Y.size());
		cout << atk-su << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << atk-(n*Y.size()+n*X.size()-X.size()*Y.size()) << endl;
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef unsigned long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<tint> X, Y;
	forn(i, m){
		tint x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		tint su = tint(X.size()*n)+tint(Y.size()*n)-tint(X.size()*Y.size());
		cout << atk-su << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << 1LL*atk-1LL*(n*Y.size()+n*X.size()-X.size()*Y.size()) << endl;
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << tint(tint(n*n)-tint(X.size()*n)-tint(Y.size()*n)+tint(X.size()*Y.size())) << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);
#define sz(x) (int)(x).size()

typedef long long tint;

using namespace std;

int main(){
	int n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << atk-(n*sz(Y)+n*sz(X)-sz(X)*sz(Y)) << endl;
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		tint su = X.size()*n+Y.size()*n-X.size()*Y.size();
		cout << 1LL*atk-1LL*su << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	int n, m; cin >> n >> m;
	tint atk = 1LL*n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << atk-1LL*X.size()*n-1LL*Y.size()*n+1LL*X.size()*Y.size() << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);
#define sz(x) (int)(x).size()

typedef long long tint;

using namespace std;

int main(){
	int n, m; cin >> n >> m;
	tint atk = tint(n)*tint(n);
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << atk-(n*sz(Y)+n*sz(X)-sz(X)*sz(Y)) << endl;
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<tint> X, Y;
	forn(i, m){
		tint x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << atk-(tint(n*Y.size())+tint(n*X.size())-tint(X.size()*Y.size())) << endl;
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);
#define sz(x) (int)(x).size()

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << tint(atk-tint(tint(n*sz(Y)+n*sz(X))-tint(sz(X)*sz(Y)))) << endl;
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);

typedef long long tint;

using namespace std;

int main(){
	NACHO;
	int n, m; cin >> n >> m;
	tint atk = 1LL*n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << 1LL*atk-1LL*X.size()*n-1LL*Y.size()*n+1LL*X.size()*Y.size() << "\n";
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);
#define sz(x) (int)(x).size()

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << tint(tint(atk)-tint(tint(n*sz(Y)+n*sz(X))-tint(sz(X)*sz(Y)))) << endl;
	}
}


#include <bits/stdc++.h>

#define forsn(i, s, n) for(int i=s;i<int(n);i++)
#define forn(i, n) forsn(i, 0, n)
#define all(v) v.begin(), v.end()
#define NACHO ios_base::sync_with_stdio(0);cin.tie(NULL);
#define sz(x) (int)(x).size()

typedef long long tint;

using namespace std;

int main(){
	tint n, m; cin >> n >> m;
	tint atk = n*n;
	set<int> X, Y;
	forn(i, m){
		int x, y; cin >> x >> y;
		X.insert(x); Y.insert(y);
		cout << atk-tint(tint(n*sz(Y)+n*sz(X))-tint(sz(X)*sz(Y))) << endl;
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
main()
{
ll n,m;
cin>>n>>m;
set<ll> row;
set<ll> column;
while(m--){
ll a,b;
cin>>a>>b;
row.insert(a);
column.insert(b);
cout<<(n*n)-((row.size()+column.size())*n)+((row.size())*(column.size()))<<" ";
}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
main()
{
ll n,m;
cin>>n>>m;
set<int> row;
set<int> column;
while(m--){
ll a,b;
cin>>a>>b;
row.insert(a);
column.insert(b);
cout<<(n*n)-((row.size()+column.size())*n)+((row.size())*(column.size()))<<" ";
}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
main()
{
ll n,m;
cin>>n>>m;
set<ll> row;
set<ll> column;
while(m--){
ll a,b;
cin>>a>>b;
row.insert(a);
column.insert(b);
cout<<(n*n)-(((ll)row.size()+(ll)column.size())*n)+(((ll)row.size())*((ll)column.size()))<<" ";
}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
main()
{
ll n,m;
cin>>n>>m;
unordered_set<ll> row;
unordered_set<ll> column;
while(m--){
ll a,b;
cin>>a>>b;
row.insert(a);
column.insert(b);
cout<<(n*n)-(((ll)row.size()+(ll)column.size())*n)+(((ll)row.size())*((ll)column.size()))<<" ";
}
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,m,i,x,y,cr=0,cc=0,mu;
    cin>>n>>m;
    bool r[n]={0},c[n]={0};
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        if(r[x-1]==0)
        {
            r[x-1]=1;
            cr++;
        }
        if(c[y-1]==0)
        {
            c[y-1]=1;
            cc++;
        }
        cr=n-cr;
        cc=n-cc;
        cout<<cc*cr;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long n,m,i,x,y,cr=0,cc=0,mu;
    cin>>n>>m;
    bool r[n]={0},c[n]={0};
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        if(r[x-1]==0)
        {
            r[x-1]=1;
            cr++;
        }
        if(c[y-1]==0)
        {
            c[y-1]=1;
            cc++;
        }
        cr=n-cr;
        cc=n-cc;
        cout<<cc*cr<<" ";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,m,i,x,y,cr=0,cc=0;
    cin>>n>>m;
    bool r[n]={0},c[n]={0};
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        if(r[x-1]==0)
        {
            r[x-1]=1;
            cr++;
            cout<<cr<<"\n";
        }
        if(c[y-1]==0)
        {
            c[y-1]=1;
            cc++;
            cout<<cc<<"\n";
        }
        cr=n-cr;
        cc=n-cc;
        cout<<cc*cr;
    }
    return 0;
}


#include <iostream>
#include <set>
#include <vector>
#define ll long long
#define vi vector<int>
#define pi pair<int, int>
#define pb push_back
#define mp make_pair
#define rep(i, n) for(int i = 0; i < n; i++)
#define rer(i, a, n) for(int i = a; i < n; i++)
#define all(x) x.begin(),x.end()
#define spider ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
int n, m;
int main() {
  spider;
  cin >> n >> m;
  ll size = n * n;
  set<int> x, y;
  vi ans;
  while (m--) {
    int a, b;
    cin >> a >> b;
    x.insert(a);
    y.insert(b);
    int big = max(x.size(), y.size());
    int small = min(x.size(), y.size());
    int p = n * big + n * small - (big * small);
    ans.pb(size - p);
  }
  for (int i : ans)
    cout << i << " ";
}


#include <iostream>
#include <set>
#include <vector>
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pi pair<int, int>
#define pb push_back
#define mp make_pair
#define rep(i, n) for(int i = 0; i < n; i++)
#define rer(i, a, n) for(int i = a; i < n; i++)
#define all(x) x.begin(),x.end()
#define spider ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
int main() {
  spider;
  ll n, m;
  cin >> n >> m;
  ll size = n * n;
  set<int> x, y;
  while (m--) {
    int a, b;
    cin >> a >> b;
    x.insert(a);
    y.insert(b);
    ll big = max(x.size(), y.size());
    ll small = min(x.size(), y.size());
    ll p = n * big + n * small - (big * small);
    cout << size - p << " ";
  }
}


#include <iostream>
#include <set>
#include <vector>
#define ll long long
#define vi vector<int>
#define pi pair<int, int>
#define pb push_back
#define mp make_pair
#define rep(i, n) for(int i = 0; i < n; i++)
#define rer(i, a, n) for(int i = a; i < n; i++)
#define all(x) x.begin(),x.end()
#define spider ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
ll size;
int n, m;
int main() {
  spider;
  cin >> n >> m;
  size = n * n;
  set<int> x, y;
  vi ans;
  while (m--) {
    int a, b;
    cin >> a >> b;
    x.insert(a);
    y.insert(b);
    int big = max(x.size(), y.size());
    int small = min(x.size(), y.size());
    int p = n * big + n * small - (big * small);
    ans.pb(size - p);
  }
  for (int i : ans)
    cout << i << " ";
}


#include <iostream>
#include <set>
#include <vector>
#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pi pair<int, int>
#define pb push_back
#define mp make_pair
#define rep(i, n) for(int i = 0; i < n; i++)
#define rer(i, a, n) for(int i = a; i < n; i++)
#define all(x) x.begin(),x.end()
#define spider ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
int main() {
  spider;
  ll n, m;
  cin >> n >> m;
  ll size = n * n;
  set<int> x, y;
  vl ans;
  while (m--) {
    int a, b;
    cin >> a >> b;
    x.insert(a);
    y.insert(b);
    ll big = max(x.size(), y.size());
    ll small = min(x.size(), y.size());
    ll p = n * big + n * small - (big * small);
    ans.pb(size - p);
  }
  for (ll i : ans)
    cout << i << " ";
}


#include<iostream>
using namespace std;
bool rows[100001],cols[100001];
int main(){
	int n ,m;
	cin>>n>>m;
	ll ans = n*n;
	memset(rows,false,sizeof rows);
	memset(cols,false,sizeof cols);
	for(int i = 0 ; i < m ; i++){
		int x ,y ;
		cin>>x>>y;
		if(!rows[x]){
			ans -= n;
			rows[x]=true;
		}
		if(!cols[y]){
			ans -=n;
			cols[y]=true;
		}
		cout<<ans<<" ";
	}
}


#include<iostream>
using namespace std;
bool rows[100001],cols[100001];
int main(){
	int n ,m;
	cin>>n>>m;
	long long ans ;
	int x = n, y = n;
	for(int i = 0 ; i < m ; i++){
		int x ,y ;
		cin>>x>>y;
		if(!rows[x]){
			x--;
			rows[x]=true;
		}
		if(!cols[y]){
			y--;
			cols[y]=true;
		}
		ans = x*y;
		cout<<ans<<" ";
	}
}


#include<iostream>
using namespace std;
bool rows[100001],cols[100001];
int main(){
	int n ,m;
	cin>>n>>m;
	long long ans = n*n;
	for(int i = 0 ; i < m ; i++){
		int x ,y ;
		cin>>x>>y;
		if(!rows[x]){
			ans -= n;
			rows[x]=true;
		}
		if(!cols[y]){
			ans -=n;
			cols[y]=true;
		}
		cout<<ans<<" ";
	}
}


#include<iostream>
using namespace std;
bool rows[100002],cols[100002];
int main(){
	int n ,m;
	cin>>n>>m;
	long long ans ;
	long long xi = n, yi = n;
	for(int i = 0 ; i < m ; i++){
		int x ,y ;
		cin>>x>>y;
		if(!rows[x]){
			xi--;
			rows[x]=true;
		}
		if(!cols[y]){
			yi--;
			cols[y]=true;
		}
		ans = xi*yi;
		cout<<ans<<" ";
	}
}


#include<iostream>
using namespace std;
bool rows[100001],cols[100001];
int main(){
	int n ,m;
	cin>>n>>m;
	long long ans ;
	int xi = n, yi = n;
	for(int i = 0 ; i < m ; i++){
		int x ,y ;
		cin>>x>>y;
		if(!rows[x]){
			xi--;
			rows[x]=true;
		}
		if(!cols[y]){
			yi--;
			cols[y]=true;
		}
		ans = xi*yi;
		cout<<ans<<" ";
	}
}


#include<bits/stdc++.h>
#define Ceil(a,b)              ((a)+(b)-1)/(b)
#define MrGAFs                 file();
#define allr(v)                ((v).rbegin()), ((v).rend())
#define all(v)                 ((v).begin()), ((v).end())
#define endl                   "\n"
const int oo = INT_MAX;
const long long  OO = LLONG_MAX;
using namespace std;
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
int dx1[] = { -1, 1, 0, 0 };
int dy1[] = { 0, 0, -1, 1 };

//functions

void file (){
  ios_base::sync_with_stdio (false);
  cout.tie (NULL);
  cin.tie (NULL);
}

//main function
int main(){
  MrGAFs
 long long n , q ;
  cin >> n >> q ;
 vector <bool> row(n,0),col(n,0);
  long long ans = n*n ;
  int x,y ;
  long long nr = 0 , nc = 0 ;
  while(q--){
    cin >> x >> y ;
    x-- , y --;
    long long  tmp = (n-1)*(row[x] + col [y]) + 1 + (nc * !row[x])+(nr * !col[y]) ;
    ans -= ((2*n) - tmp);
    if(!row[x]) nr++;
    if(!col[y]) nc++;
    row[x] = true ;
    col[y] = true ;
    cout << ans << ' ';
  }

}


#include<bits/stdc++.h>
#define Ceil(a,b)              ((a)+(b)-1)/(b)
#define MrGAFs                 file();
#define allr(v)                ((v).rbegin()), ((v).rend())
#define all(v)                 ((v).begin()), ((v).end())
#define endl                   "\n"
const int oo = INT_MAX;
const long long  OO = LLONG_MAX;
using namespace std;
int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };
int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };
int dx1[] = { -1, 1, 0, 0 };
int dy1[] = { 0, 0, -1, 1 };

//functions

void file (){
  ios_base::sync_with_stdio (false);
  cout.tie (NULL);
  cin.tie (NULL);
}

//main function
int main(){
  MrGAFs
 long long n , q ;
  cin >> n >> q ;
 vector <bool> row(n,0),col(n,0);
  long long ans = n*n ;
  int x,y ;
  int nr = 0 , nc = 0 ;
  int t = q ;
  while(t--){
    cin >> x >> y ;
    x-- , y --;
    int tmp = (n-1)*(row[x] + col [y]) + 1 + (nc * !row[x])+(nr * !col[y]) ;
    ans -= ((2*n) - tmp);
    if(!row[x]) nr++;
    if(!col[y]) nc++;
    row[x] = true ;
    col[y] = true ;
    cout << ans << ' ';
  }

}


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

int main(void){ios_base::sync_with_stdio(0); cin.tie(0) ; cout.tie(0);
    short t;
    cin >> t;
    while(t--){
        int n,mi = 10000,ma = -1,a=-1 , b= -1,i;
        cin >> n;
        bool flag = false,ok = false;
        vector<int> v(n);
        for( i=0;i<n;i++){
            cin >> v[i];
            if(!flag){
                if(v[i] < mi){
                    mi = v[i];
                    a = i;
                }
                if(v[i] > mi){
                    flag = true;
                }
            }
            if(flag and !ok){
                if(v[i] > ma){
                    ma = v[i];
                    b = i;
                }
                if(v[i] < ma){
                    ok = true;
                    break;
                }
            }
        }
        if(flag and ok)
            cout << "YES" << endl <<  a+1 << " " << b+1 << " " << i+1 << endl;
        else
            cout << "NO" << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main(void){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
       short t;
       cin >> t;
       while(t--){
              int n;
              cin >> n;
              int a[n] ;
              for(int i=0;i<n;i++)
                     cin >> a[i];
              for(int i=1;i<n-1;i++){
                     if(a[i] > a[i-1] and a[i] < a[i+1]){
                            cout << "YES" << i-1 << " " << i << " " << i+1 << endl;
                            continue ;
                     }
              }
              cout << "NO" << endl;
       }
}


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

int main(void){ios_base::sync_with_stdio(0); cin.tie(0) ; cout.tie(0);
    short t;
    cin >> t;
    while(t--){
        int n,mi = 10000,ma = -1 , a = -1 , b = -1,i;
        cin >> n;
        bool ok = false;
        vector<int> v(n);
        for( i=0;i<n;i++){
            cin >> v[i];
            if(v[i] < mi and i < b){
                a = i;
                mi = v[i];
            }
            else if(v[i] < mi and a == -1){
                a = i;
                mi = v[i];
            }
            if(v[i] > ma and i > a){
                b = i;
                ma = v[i];
            }
            else if(v[i] > ma and b == -1){
                b = i;
                ma = v[i];
            }
            if(v[i] > mi and v[i] < ma){
                ok = true;
                break;
            }
        }
        if(ok)
            cout << "YES" << endl << a+1 << " " << b+1 << " " << i+1 << endl;
        else
            cout << "NO" << endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        int arr[1001];
        for(int i=0;i<n;i++)
           cin>>arr[i];
        int i;
        bool flag = true;
        for(i=1;i<n-1;i++)
        {
            if(arr[i-1]<arr[i] && arr[i]>arr[i+1])
            {
                flag=false;
                cout<<"YES"<<endl;
                cout<<i<<" "<<i+1<<" "<<i+2<<endl;
                break;
            }
        }
        if(flag)
        {
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        int arr[n];
        for(int i=0;i<n;i++)
           cin>>arr[i];
        int i;
        bool flag = true;
        for(i=1;i<n-1;i++)
        {
            if(arr[i-1]<arr[i] && arr[i]>arr[i+1])
            {
                flag=false;
                cout<<"YES"<<endl;
                cout<<i<<" "<<i+1<<" "<<i+2<<endl;
                break;
            }
        }
        if(flag)
        {
            cout<<"NO"<<endl;
        }
    }
    return 0;
}


#include<iostream>
#include<vector>

using namespace std;

void solve() {
	int n;
	cin >> n;
	vector<int> nums(n + 1);
	for (size_t i = 0; i < n; ++i) {
		int tmp;
		cin >> tmp;
		nums[tmp] = i + 1;
	}
	int left = 1;
	int right = n;
	for (size_t i = nums.size(); i != 1;) {
		--i;
		if (nums[i] != left && nums[i] != right) {
			cout << "YES\n";
			cout << left << " " << nums[i] << " " << right << "\n";
			return;
		}
		else
		{
			if (nums[i] == left) {
				++left;
			}
			else {
				--right;
			}
		}

	}
	cout << "NO\n";
	return;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t;
	cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}


#include<iostream>
#include<cstdlib>
#include<string>
#define MAX 1000
using namespace std;
struct out {
	string x;
	int b[3] = { 0 };
};
void xxx(int a[], int n, out *&Xuat, int &m) {
	for (int i = 1; i < n - 1; i++) {
		if (a[i - 1] < a[i] && a[i] > a[i + 1]) {
			Xuat[m].b[0] = i - 1 + 1;
			Xuat[m].b[1] = i + 1;
			Xuat[m].b[2] = i + 1 + 1;
			Xuat[m].x = "NO";
			m++;
			return;
		}
	}
	Xuat[m].x = "YES";
	m++;
}
int main() {
	int a[MAX];
	int t, n, m = 0;
	cin >> t;
	out *Xuat = new out[t];
	for (int i = 0; i < t; i++) {
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		xxx(a, n, Xuat, m);
	}
	for (int i = 0; i < t; i++) {
		cout << Xuat[i].x << endl;
		if (Xuat[i].x == "YES") {
			for (int j = 0; j < 3; j++)
				cout << Xuat[i].b[j] << " ";
		}
		cout << endl;
	}
	system("pause");
	return 0;
}


#include<iostream>
#include<cstdlib>
#include<string>
#define MAX 1000
using namespace std;
struct out {
	string x;
	int b[3];
};
void xxx(int a[], int n, out *&Xuat, int &m) {
	for (int k = n - 1; k >= 2; k--) {
		for (int j = k - 1; j >= 1; j--) {
			for (int i = j - 1; i >= 0; i--) {
				if (a[j] > a[k] && a[j] > a[i]) {
					Xuat[m].x = "YES";
					Xuat[m].b[0] = i + 1;
					Xuat[m].b[1] = j + 1;
					Xuat[m].b[2] = k + 1;
					m++;
					return;
				}
			}
		}
	}
	Xuat[m].x = "NO";
	m++;
}
int main() {
	int a[MAX];
	int t, n, m = 0;
	cin >> t;
	out *Xuat = new out[t];
	for (int i = 0; i < t; i++) {
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		xxx(a, n, Xuat, m);
	}
	for (int i = 0; i < t; i++) {
		cout << Xuat[i].x << endl;
		if (Xuat[i].x == "YES") {
			for (int j = 0; j < 3; j++)
				cout << Xuat[i].b[j] << " ";
		}
		cout << endl;
	}
	system("pause");
	return 0;
}


#include<iostream>
#include<cstdlib>
#include<string>
#define MAX 1000
using namespace std;
struct out {
	string x;
	int b[3] = { 0 };
};
void xxx(int a[], int n, out *&Xuat, int &m) {
	for (int i = 0; i < n - 2; i++) {
		if (a[i] < a[i + 1] && a[i + 1] > a[i + 2]) {
			Xuat[m].b[0] = i + 1;
			Xuat[m].b[1] = i + 1 + 1;
			Xuat[m].b[2] = i + 2 + 1;
			Xuat[m].x = "YES";
			m++;
			return;
		}
	}
	Xuat[m].x = "NO";
	m++;
}
int main() {
	int a[MAX];
	int t, n, m = 0;
	cin >> t;
	out *Xuat = new out[t];
	for (int i = 0; i < t; i++) {
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		xxx(a, n, Xuat, m);
	}
	for (int i = 0; i < t; i++) {
		cout << Xuat[i].x << endl;
		if (Xuat[i].x == "YES") {
			for (int j = 0; j < 3; j++)
				cout << Xuat[i].b[j] << " ";
			cout << endl;
		}
	}
	system("pause");
	return 0;
}


#include<iostream>
#include<cstdlib>
#include<string>
#define MAX 1000
using namespace std;
struct out {
	string x;
	int b[3] = { 0 };
};
void xxx(int a[], int n, out Xuat[], int &m) {
	for (int i = 1; i < n - 1; i++) {
		if (a[i - 1] < a[i] && a[i] > a[i + 1]) {
			Xuat[m].b[0] = i - 1 + 1;
			Xuat[m].b[1] = i + 1;
			Xuat[m].b[2] = i + 1 + 1;
			Xuat[m].x = "YES";
			m++;
			return;
		}
	}
	Xuat[m].x = "NO";
	m++;
}
int main() {
	int a[MAX];
	int t, n, m = 0;
	cin >> t;
	out Xuat[200];
	for (int i = 0; i < t; i++) {
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		xxx(a, n, Xuat, m);
	}
	for (int i = 0; i < t; i++) {
		cout << Xuat[i].x << endl;
		if (Xuat[i].x == "YES") {
			for (int j = 0; j < 3; j++)
				cout << Xuat[i].b[j] << " ";
		}
		cout << endl;
	}
	system("pause");
	return 0;
}


#include<iostream>
#include<cstdlib>
#include<string>
#define MAX 1000
using namespace std;
struct out {
	string x;
	int b[3] = { 0 };
};
void xxx(int a[], int n, out *&Xuat, int &m) {
	for (int i = 1; i < n - 1; i++) {
		if (a[i - 1] < a[i] && a[i] > a[i + 1]) {
			Xuat[m].b[0] = i - 1 + 1;
			Xuat[m].b[1] = i + 1;
			Xuat[m].b[2] = i + 1 + 1;
			Xuat[m].x = "YES";
			m++;
			return;
		}
	}
	Xuat[m].x = "NO";
	m++;
}
int main() {
	int a[MAX];
	int t, n, m = 0;
	cin >> t;
	out *Xuat = new out[t];
	for (int i = 0; i < t; i++) {
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		xxx(a, n, Xuat, m);
	}
	for (int i = 0; i < t; i++) {
		cout << Xuat[i].x << endl;
		if (Xuat[i].x == "YES") {
			for (int j = 0; j < 3; j++)
				cout << Xuat[i].b[j] << " ";
		}
		cout << endl;
	}
	system("pause");
	return 0;
}


#include<iostream>
#include<cstdlib>
#include<string>
#define MAX 1000
using namespace std;
struct out {
	string x;
	int b[3] = { 0 };
};
void xxx(int a[], int n, out *&Xuat, int &m) {
	for (int i = 0; i < n - 2; i++) {
		if (a[i] < a[i + 1] && a[i + 1] > a[i + 2]) {
			Xuat[m].b[0] = i + 1;
			Xuat[m].b[1] = i + 1 + 1;
			Xuat[m].b[2] = i + 2 + 1;
			Xuat[m].x = "YES";
			m++;
			return;
		}
	}
	Xuat[m].x = "NO";
	m++;
}
int main() {
	int a[MAX];
	int t, n, m = 0;
	cin >> t;
	out *Xuat = new out[t];
	for (int i = 0; i < t; i++) {
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		xxx(a, n, Xuat, m);
	}
	for (int i = 0; i < t; i++) {
		cout << Xuat[i].x << endl;
		if (Xuat[i].x == "YES") {
			for (int j = 0; j < 3; j++)
				cout << Xuat[i].b[j] << " ";
			cout << endl;
		}
	}
	return 0;
}


#include<iostream>
#include<cstdlib>
#include<string>
#define MAX 1000
using namespace std;
struct out {
	string x;
	int b[3] = { 0 };
};
void xxx(int a[], int n, out *&Xuat, int &m) {
	for (int i = 0; i < n - 2; i++) {
		if (a[i] < a[i + 1] && a[i + 1] > a[i + 2]) {
			Xuat[m].b[0] = i + 1;
			Xuat[m].b[1] = i + 1 + 1;
			Xuat[m].b[2] = i + 2 + 1;
			Xuat[m].x = "YES";
			m++;
			return;
		}
	}
	Xuat[m].x = "NO";
	m++;
}
int main() {
	int a[MAX];
	int t, n, m = 0;
	cin >> t;
	out *Xuat = new out[t];
	for (int i = 0; i < t; i++) {
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		xxx(a, n, Xuat, m);
	}
	for (int i = 0; i < t - 1; i++) {
		cout << Xuat[i].x << endl;
		if (Xuat[i].x == "YES") {
			for (int j = 0; j < 3; j++)
				cout << Xuat[i].b[j] << " ";
			cout << endl;
		}
	}
	cout << Xuat[t - 1].x;
	if (Xuat[t - 1].x == "YES") {
		for (int j = 0; j < 3; j++)
			cout << Xuat[t - 1].b[j] << " ";
	}
	system("pause");
	return 0;
}


#include<iostream>
#include<cstdlib>
#include<string>
#define MAX 1000
using namespace std;
struct out {
	string x;
	int b[3];
};
void xxx(int a[], int n, out *&Xuat, int &m) {
	for (int i = 0; i < n - 2; i++) {
		for (int j = i + 1; j < n - 1; j++) {
			for (int k = j + 1; k < n; k++) {
				if (a[j] > a[k] && a[j] > a[i]) {
					Xuat[m].x = "YES";
					Xuat[m].b[0] = i + 1;
					Xuat[m].b[1] = j + 1;
					Xuat[m].b[2] = k + 1;
					m++;
					return;
				}
			}
		}
	}
	Xuat[m].x = "NO";
	m++;
}
int main() {
	int a[MAX];
	int t, n, m = 0;
	cin >> t;
	out *Xuat = new out[t];
	for (int i = 0; i < t; i++) {
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		xxx(a, n, Xuat, m);
	}
	for (int i = 0; i < t; i++) {
		cout << Xuat[i].x << endl;
		if (Xuat[i].x == "YES") {
			for (int j = 0; j < 3; j++)
				cout << Xuat[i].b[j] << " ";
		}
		cout << endl;
	}
	system("pause");
	return 0;
}


#include<iostream>
#include<cstdlib>
#include<string>
#define MAX 1000
using namespace std;
struct out {
	string x;
	int b[3] = { 0 };
};
void xxx(int a[], int n, out *&Xuat, int &m) {
	for (int i = 0; i < n - 2; i++) {
		if (a[i] < a[i + 1] && a[i + 1] > a[i + 2]) {
			Xuat[m].b[0] = i + 1;
			Xuat[m].b[1] = i + 1 + 1;
			Xuat[m].b[2] = i + 2 + 1;
			Xuat[m].x = "YES";
			m++;
			return;
		}
	}
	Xuat[m].x = "NO";
	m++;
}
int main() {
	int a[MAX];
	int t, n, m = 0;
	cin >> t;
	out *Xuat = new out[t];
	for (int i = 0; i < t; i++) {
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a[i];
		}
		xxx(a, n, Xuat, m);
	}
	for (int i = 0; i < t; i++) {
		cout << Xuat[i].x << endl;
		if (Xuat[i].x == "YES") {
			for (int j = 0; j < 3; j++)
				cout << Xuat[i].b[j] << " ";
		}
		cout << endl;
	}
	system("pause");
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n,l=0;
		cin >> n;
		int* mas = new int[n];
		for (int i = 0; i < n; i++)
			cin >> mas[i];
		for (int i = 0; i <n; i++)
		{
			if (mas[i] > mas[i + 1])
				break;
			for (int j = i + 1; j < n; j++)
			{
				if (mas[i] < mas[j])
				{
					for (int k = j + 1; k < n; k++)
					{
						if (mas[j]>mas[k])
						{
							cout << "YES " << endl << i + 1 << " " << j + 1 << " " << k + 1 << endl;
							l++;
							break;

						}
					}
					if (l > 0)
						break;
				}

			}
			if (l > 0)
				break;
		}
		if (l == 0)
			cout<<"NO"<<endl;
	}
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n,l=0;
		cin >> n;
		int* mas = new int[n];
		for (int i = 1; i <= n; i++)
			cin >> mas[i];
		for (int i = 1; i <=n; i++)
		{
			for (int j = i + 1; j <= n; j++)
			{
				for (int k = j + 1; k <= n; k++)
				{
					if (mas[i]<mas[j] && mas[j]>mas[k])
					{
						cout << "YES "<<endl << i << " " << j << " " << k<<endl;
						l++;
						break;

					}
				}
				if (l > 0)
					break;

			}
			if (l > 0)
				break;
		}
		if (l == 0)
			cout<<"NO"<<endl;
	}
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n,l=0;
		cin >> n;
		int* mas = new int[n];
		for (int i = 0; i < n; i++)
			cin >> mas[i];
		for (int i = 0; i <=n; i++)
		{
			for (int j = i + 1; j <= n; j++)
			{
				if (mas[i] < mas[j])
				{
					for (int k = j + 1; k < n; k++)
					{
						if (mas[j]>mas[k])
						{
							cout << "YES " << endl << i + 1 << " " << j + 1 << " " << k + 1 << endl;
							l++;
							break;

						}
					}
					if (l > 0)
						break;
				}

			}
			if (l > 0)
				break;
		}
		if (l == 0)
			cout<<"NO"<<endl;
	}
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n,l=0;
		cin >> n;
		int* mas = new int[n];
		for (int i = 0; i < n; i++)
			cin >> mas[i];
		for (int i = 0, j=i+1; i <n, j<n; i++, j++)
		{

			if (mas[i] < mas[j])
			{
				for (int k = j + 1; k < n; k++)
				{
					if (mas[j] > mas[k])
					{
						cout << "YES " << endl << i + 1 << " " << j + 1 << " " << k + 1 << endl;
						l++;
						break;

					}
				}
				if (l > 0)
					break;
			}

			if (l > 0)
				break;
		}
		if (l == 0)
			cout<<"NO"<<endl;
	}
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n,l=0;
		cin >> n;
		int* mas = new int[n];
		for (int i = 0; i < n; i++)
			cin >> mas[i];
		for (int i = 0; i <=n; i++)
		{
			for (int j = i + 1; j <= n; j++)
			{
				for (int k = j + 1; k < n; k++)
				{
					if (mas[i]<mas[j] && mas[j]>mas[k])
					{
						cout << "YES "<<endl << i+1 << " " << j+1<< " " << k+1<<endl;
						l++;
						break;

					}
				}
				if (l > 0)
					break;

			}
			if (l > 0)
				break;
		}
		if (l == 0)
			cout<<"NO"<<endl;
	}
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n,l=0;
		cin >> n;
		int* mas = new int[n];
		for (int i = 0; i < n; i++)
			cin >> mas[i];
		for (int i = 0; i <n; i++)
		{
			for (int j = i + 1; j < n; j++)
			{
				if (mas[i] < mas[j])
				{
					for (int k = j + 1; k < n; k++)
					{
						if (mas[j]>mas[k])
						{
							cout << "YES " << endl << i + 1 << " " << j + 1 << " " << k + 1 << endl;
							l++;
							break;

						}
					}
					if (l > 0)
						break;
				}

			}
			if (l > 0)
				break;
		}
		if (l == 0)
			cout<<"NO"<<endl;
	}
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n,l=0;
		cin >> n;
		int* mas = new int[n];
		for (int i = 0; i < n; i++)
			cin >> mas[i];
		for (int i = 0; i <=n; i++)
		{
			for (int j = i + 1; j <= n; j++)
			{
				for (int k = j + 1; k <= n; k++)
				{
					if (mas[i]<mas[j] && mas[j]>mas[k])
					{
						cout << "YES "<<endl << i+1 << " " << j+1<< " " << k+1<<endl;
						l++;
						break;

					}
				}
				if (l > 0)
					break;

			}
			if (l > 0)
				break;
		}
		if (l == 0)
			cout<<"NO"<<endl;
	}
	//system("pause");
	return 0;
}


#include <iostream>
#include<iomanip>
#include<cstring>
int nums[1000];
using namespace std;
int main()
{
	int c, n;
	cin >> c;
	while (c-- > 0) {
		int pi=0, pj=0, pk=0;
		cin >> n;
		memset(nums, 0, 1000);
		for (int i = 0; i < n; ++i)
		{
			cin >> nums[i];
		}
		int i;
		for (i = 1; i < n-1; ++i)
		{
			int condition = 2;
			for (int j = i - 1; j >= 0; --j)
			{
				if (nums[i] > nums[j])
				{
					--condition;
					pi = nums[j];
					break;
				}
			}
			for (int j = i + 1; j < n; ++j)
			{
				if (nums[i] > nums[j])
				{
					--condition;
					pk = nums[j];
					break;
				}
			}
			if (condition == 0)
			{
				pj = nums[i];
				break;
			}
		}
		if (i != n - 1)
		{
			cout << "YES" << endl;
			if (pi > pk) swap(pi, pk);
			cout << pi << ' ' << pk << ' ' << pj << endl;
		}
		else
			cout << "NO" << endl;
	}
}


#include <iostream>
#include<iomanip>
#include<cstring>
int nums[1000];
using namespace std;
int main()
{
	int c, n;
	cin >> c;
	while (c-- > 0) {
		int ai=0, aj=0, ak=0;
		cin >> n;
		memset(nums, 0, 1000);
		for (int i = 0; i < n; ++i)
		{
			cin >> nums[i];
		}
		int i;
		for (i = 1; i < n-1; ++i)
		{
			int condition = 2;
			for (int j = i - 1; j >= 0; --j)
			{
				if (nums[i] > nums[j])
				{
					--condition;
					ai = j + 1;
					break;
				}
			}
			for (int j = i + 1; j < n; ++j)
			{
				if (nums[i] > nums[j])
				{
					--condition;
					ak = j + 1;
					break;
				}
			}
			if (condition == 0)
			{
				aj = i + 1;
				break;
			}
		}
		if (i != n - 1)
		{
			cout << "YES" << endl;
			cout << ai << ' ' << aj << ' ' << ak << endl;
		}
		else
			cout << "NO" << endl;
	}
}


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

using namespace std;

int main(){
	int t,x,y,n;
	cin>>t;
	while(t--){
		cin>>n;
		bool flag1 = false , flag2 = false;
		int a = 2000, b = 0;
		int indx1 , indx2 , indx3;
		for(int i = 0 ; i < n ; i++){
			cin>>x;
			if( flag1 == false){
				if(x > a){
					b = x;
					indx2 = i + 1;
					flag1 = true;
				} else if( x < a){
					a = x;
					indx1 = i + 1;
				}
			}else if (flag2 == false){
				if(x < b){
					flag2 = true;
					indx3 = i + 1;
				} else{
					b = x;
					indx2 = i + 1;
				}
			}
		}
		if(flag1 && flag2)
			cout<<"YES"<<endl<<indx1<<" "<<indx2<<" "<<indx3<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}


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

using namespace std;

int main(){
	int t,x,y,n;
	cin>>t;
	while(t--){
		cin>>n;
		bool flag1 = false , flag2 = false;
		int a = 2000, b = 0,c = 0;
		int indx1 , indx2 , indx3;
		for(int i = 0 ; i < n ; i++){
			cin>>x;
			if( flag1 == false){
				if(x > a){
					b = x;
					indx2 = i + 1;
					flag1 = true;
				} else if( x < a){
					a = x;
					indx1 = i + 1;
				}
			}else{
				if(x < b){
					flag2 = true;
					indx3 = i + 1;
					break;
				} else{
					b = x;
					indx2 = i + 1;
				}
			}
		}
		if(flag1 && flag2)
			cout<<"YES"<<endl<<indx1<<" "<<indx2<<" "<<indx3<<endl;
		else
			cout<<"NO"<<endl;
	}
	return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <bitset>
#include <iomanip>
#include <float.h>
#define _USE_MATH_DEFINES
#include <math.h>

#define ll long long

#define FOR(i,a,b)        for(ll i=(a);i<(b);i++)
#define REP(i,n)        FOR(i,0,n)
#define SORT(v)            sort((v).begin(),(v).end())
#define UN(v)            SORT(v),(v).erase(unique((v).begin(),(v).end()),(v).end())
#define CL(a,b)            memset(a,b,sizeof a)
#define pb                push_back

#ifndef M_PI
    #define M_PI 3.14159265358979323846
#endif

using namespace std;

//#define N 1000009
ll denom = 1e9+7;
ll powmod(ll a,ll b) {ll res=1;a%=denom; for(;b;b>>=1){if(b&1)res=res*a%denom;a=a*a%denom;}return res;}

int main(int argc, const char * argv[])
{
    ios_base::sync_with_stdio(false);
    ll t; cin >> t;
    REP(i, t) {
        ll n; cin >> n;
        vector<ll> a(n); REP(j, n) cin >> a[j];
        ll s = 0;
        while (s < n-1 && a[s] >= a[s+1]) s++;
        ll b = s+1;
        while (b < n-1 && a[b+1] >= a[b]) b++;
        if (b < n-1) {
            cout << "YES" << endl;
            cout << s+1 << " " << b+1 << " " << b+2 << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <cmath>
#define endl "\n"

using ll = long long;
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        vector<int> V(n);
        for (auto& it : V)cin >> it;
        string s = "NO";
        int x = 0;
        for (int i = 1;i < n - 1;i++) {
            if (V[i] > V[i - 1] && V[i] > V[i + 1]) {
                s = "YES";
                x = i;
            }
        }
        cout << s << endl;
        if (x != 0) {
            cout << x  <<' '<< x+1 <<' '<< x + 2 << endl;

        }

    }
    return 0;
}


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

using namespace std;

int main() {
	long mas[2000];
	long t;
	cin >> t;
	for (int i = 0; i < t; i++) {
		long n;
		cin >> n;
		for (int j = 0; j < n; j++) {
			cin >> mas[j];
		}
		bool f = false;
		for (int j = 1; j < n - 1; j++) {
			if (mas[j] > mas[j - 1] && mas[j] > mas[j + 1]) {
				cout << "YES" << endl;
				cout << j << ' ' << j+1 << ' ' << j + 2 << endl;
				f = true;
				break;
			}
		}
		if (!f) cout << "NO" << endl;
	}
	return 0;
}


#include <iostream>
#include <math.h>
#include <algorithm>

using namespace std;
#define ll long long
ll n, k;
ll lens[10002];

int main() {
	int t;
	cin >> t;
	while (t--) {
		bool yes = false;

		int a,b,c ,n;
		cin >> n;
		int num, prev;
		cin >> num;

		bool increase = false;
		for (int i = 2; i <= n; i++) {
			prev = num;
			cin >> num;
			if (!yes) {
				if (num > prev) {
					a = i - 1;
					increase = true;
				}
				else if (increase && num < prev) {
					yes = true;
					b = i - 1;
					c = i;
				}
			}
		}
		if (yes)
			cout << "YES\n" << a << " " << b << ' ' << c << endl;
		else
			cout << "NO\n";
	}
}


#include <iostream>
#include <math.h>
#include <algorithm>

using namespace std;
#define ll long long
ll n, k;
ll lens[10002];

int main() {
	int t;
	cin >> t;
	while (t--) {
		bool yes = false;

		int n;
		cin >> n;
		int num, prev;
		cin >> num;

		bool increase = false;
		for (int i = 2; i <= n; i++) {
			prev = num;
			cin >> num;
			if (num > prev)
				increase = true;
			else if (increase && num < prev)
				yes = true;
		}
		if (yes)
			cout << "YES\n";
		else
			cout << "NO\n";
	}
}


#include <iostream>
#include <math.h>
#include <algorithm>

using namespace std;
#define ll long long
ll n, k;
ll lens[10002];

int main() {
	int t;
	cin >> t;
	while (t--) {
		bool yes = false;

		int a,b,c ,n;
		cin >> n;
		int num, prev;
		cin >> num;

		bool increase = false;
		for (int i = 2; i <= n; i++) {
			prev = num;
			cin >> num;
			if (num > prev) {
				a = i - 1;
				increase = true;
			}
			else if (increase && num < prev) {
				yes = true;
				b = i - 1;
				c = i;
			}
		}
		if (yes)
			cout << "YES\n" << a << " " << b << ' ' << c << endl;
		else
			cout << "NO\n";
	}
}


#include "stdafx.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

int t,n;
int a;

void go(vector<int> v) {
	for (int i = 0; i < n - 2; i++)
	{
		if (v[i]<v[i+1] && v[i+1]>v[i+2])
		{
			cout << "YES"<<endl;
			for (int j = 0; j < 3; j++)
			{
				cout << (i+j+1) << " ";
			}
			cout << endl;
			return;
		}
	}
	cout << "NO"<<endl;
}

int main()
{
	cin >> t;
	while (t--) {
		cin >> n;
		vector<int> v;
		for (int i = 0; i < n; i++)
		{
			cin >> a;
			v.push_back(a);
		}
		go(v);
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

int t,n;
int a;

void go(vector<int> v) {
	for (int i = 0; i < n - 2; i++)
	{
		if (v[i]<v[i+1] && v[i+1]>v[i+2])
		{
			cout << "YES"<<endl;
			for (int j = 0; j < 3; j++)
			{
				cout << (i+j+1) << " ";
			}
			cout << endl;
			return;
		}
	}
	cout << "NO"<<endl;
}

int main()
{
	cin >> t;
	while (t--) {
		cin >> n;
		vector<int> v;
		for (int i = 0; i < n; i++)
		{
			cin >> a;
			v.push_back(a);
		}
		go(v);
	}
	return 0;
}


#include<iostream>
using namespace std;
int main() {
	int T;
	cin >> T;
	for (int i = 0; i < T; i++) {
		int n;
		int p[1001] = { 0, };
		cin >> n;
		for (int j = 0; j < n; j++) {
			cin >> p[j];
		}
		bool chk = false;
		for (int a = 1; a < n; a++) {
			if (chk)break;
			int mnLeft = 1e9;
			int posLeft;
			for (int b = 0; b < a; b++) {
				if (mnLeft > p[b]) {
					mnLeft = p[b];
					posLeft = b;
				}
			}
			int mnRight = 1e9;
			int posRight;
			for (int c = a + 1; c < n; c++) {
				if (mnRight > p[c]) {
					mnRight = p[c];
					posRight = c;
				}
			}
			if (mnLeft<p[a]&&mnRight<p[a]) {
				cout << "YES" << "\n";
				cout << posLeft + 1 << " " << a + 1 << " " << posRight + 1 << "\n";
				chk = true;
			}
		}
		if (!chk) {
			cout << "NO" << "\n";
		}
	}
	return 0;
}


#include<iostream>
using namespace std;
int main() {
	int T;
	cin >> T;
	for (int i = 0; i < T; i++) {
		int n;
		int p[1001] = { 0, };
		cin >> n;
		for (int j = 0; j < n; j++) {
			cin >> p[j];
		}
		bool chk = false;
		for (int a = 0; a < n; a++) {
			if (chk)break;
			for (int b = a + 1; b < n; b++) {
				if (chk)break;
				for (int c = b + 1; c < n; c++) {
					if (p[a]<p[b] && p[b]>p[c]) {
						chk = true;
						cout << "YES" << "\n";
						cout << a+1 << " " << b+1 << " "<<c+1 << "\n";
						break;
					}
				}
			}
		}
		if (!chk) {
			cout << "NO" << "\n";
		}
	}
	return 0;
}


#include <iostream>
#include <vector>

using namespace std;

//#define DEBUG

int main()
{
#ifdef DEBUG
    freopen("input.txt", "r", stdin);
#endif //DEBUG

    ios_base::sync_with_stdio(0), cin.tie(0);
    int test;
    cin >> test;

    while(test--)
    {
        int n;
        cin >> n;
        vector<int> a(n);
        for (auto &it : a) cin >> it;
        bool left_ok = false;
        bool right_ok = false;
        bool ok = false;
        int left;
        int right;

        for (int i = 1; i < n -1; ++i) {
            for (int j = i - 1; j >= 0; --j) {
                if (a[i] > a[j]) {
                    left_ok = true;
                    left = j + 1;
                }
            }
            for (int k = i + 1; k < n; ++k) {
                if (a[i] > a[k]) {
                    right_ok = true;
                    right = k + 1;
                }
            }
            if (left_ok && right_ok) {
                cout << "YES\n" << left << " " << i + 1  << " " << right << "\n";
                ok = true;
                break;
            }
            left_ok = false;
            right_ok = false;
        }

        if(!ok) {
            cout << "NO\n";
        }

    }

    return 0;
}


#include <iostream>
#include <vector>

using namespace std;

//#define DEBUG

int main()
{
#ifdef DEBUG
    freopen("input.txt", "r", stdin);
#endif //DEBUG

    ios_base::sync_with_stdio(0), cin.tie(0);
    int test;
    cin >> test;

    while(test--)
    {
        int n;
        cin >> n;
        vector<int> a(n);
        for (auto &it : a) cin >> it;
        bool left_ok = false;
        bool right_ok = false;
        bool ok = false;
        int left;
        int right;

        for (int i = 1; i < n -1; ++i) {
            for (int j = i - 1; j >= 0; --j) {
                if (a[i] > a[j]) {
                    left_ok = true;
                    left = a[j];
                }
            }
            for (int k = i + 1; k < n; ++k) {
                if (a[i] > a[k]) {
                    right_ok = true;
                    right = a[k];
                }
            }
            if (left_ok && right_ok) {
                cout << "YES\n" << a[i] << " " << left  << " " << right << "\n";
                ok = true;
                break;
            }
            left_ok = false;
            right_ok = false;
        }

        if(!ok) {
            cout << "NO\n";
        }

    }

    return 0;
}


#include<iostream>
using namespace std;
int a[1005];
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		bool flag = false;
		int n;
		cin >> n;
		for (int i = 1;i <= n;i++)cin >> a[i];
		for (int i = 2;i < n;i++)
		{
			int t = 0, tt = 0;
			bool flag1 = false, flag2 = false;
			for (int j = 1;j < i;j++)
			{
				if (a[j] < a[i])
				{
					flag1 = true;
					t = j;
					break;
				}
			}
			for (int j = i + 1;j <= n;j++)
			{
				if (a[j] < a[i])
				{
					flag2 = true;
					tt = j;
					break;
				}
			}
			if (flag1 == true && flag2 == true)
			{
				flag = true;
				cout << "YES" << endl;
				cout << t << " " << i << " " << tt << endl;
				break;
			}
		}
		if (!flag)cout << "NO" << endl;
	}
	return 0;
}


/*
URL_HERE
*/
/*

*/
#ifdef _WIN32
#pragma warning(disable:4996)
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <math.h>
#include <limits.h>
#include <queue>
#include <iostream>
using namespace std;

FILE* _fin = stdin;
FILE* _fout = stdout;
#define PI 3.141592653589793238462643383279502884197169399375105820974
#define ten5p1 100001
#define ten6p1 1000001
#define ten8p1 100000001
#define ten9p1 1000000001
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define rep(var,n) for(int var=0;var<n;++var)
#define repi(n) rep(i,n)
#define repj(n) rep(j,n)
#define repi1(n) for(int i=1;i<n;++i)
#define repj1(n) for(int j=1;j<n;++j)
int _min(int a, int b) { return a <= b ? a : b; }
ll _min(ll a, ll b) { return a <= b ? a : b; }
int _max(int a, int b) { return a >= b ? a : b; }
ll _max(ll a, ll b) { return a >= b ? a : b; }
void zero(int* data, int n) { memset(data, 0, sizeof(int) * n); }
void zero(ll* data, int n) { memset(data, 0, sizeof(ll) * n); }
void zero(unsigned long long* data, int n) { memset(data, 0, sizeof(unsigned long long) * n); }
void zero(char* data, int n) { memset(data, 0, sizeof(char) * n); }
char readc() { char var; fscanf(_fin, "%c", &var); return var; }
int readi() { int var; fscanf(_fin, "%d", &var); return var; }
double readlf() { double var; fscanf(_fin, "%lf", &var); return var; }
ll readll() { ll var; fscanf(_fin, "%lld", &var); return var; }
void repread(int* data, int n) { repi(n) data[i] = readi(); }
void repread(ll* data, int n) { repi(n) data[i] = readll(); }
int reads(char* str, int maxsize)
{
	for (;;) { if (fgets(str, maxsize, _fin) == NULL) break; if (str[0] != '\n' && str[0] != '\r') break; }
	int slen = strlen(str); if (slen == 0) return 0;
	if (str[slen - 1] == '\n' || str[slen - 1] == '\r') str[--slen] = 0;
	return slen;
}

#define writec(var) fprintf(_fout,"%c",var)
#define writecsp(var) fprintf(_fout,"%c ",var)
#define writecln(var) fprintf(_fout,"%c\n",var)
#define writei(var) fprintf(_fout,"%d",var)
#define writeisp(var) fprintf(_fout,"%d ",var)
#define writellsp(var) fprintf(_fout,"%lld ",var)
#define writeiln(var) fprintf(_fout,"%d\n",var)
#define writellln(var) fprintf(_fout,"%lld\n",var)
#define writeulln(var) fprintf(_fout,"%llu\n",var)
#define writefln(var) fprintf(_fout,"%f\n",var)
#define writes(str) fprintf(_fout,"%s",str)
#define writesp() fprintf(_fout," ")
#define writeln() fprintf(_fout,"\n")
#define RUN_LOCAL(testfilename) {_fin = fopen(testfilename, "r"); if(_fin==NULL) _fin=stdin;}
#define swap(type,a, b) {type t=a;a=b;b=t;}
#define sort(data,n) std::sort(data,data+n)
//#define mod(a,b) b==0 ? 0 : a==0 ? 0 :(a>0 ? a%b : b + a % b) //what the hell is this...
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return (a / g) * b; }
void reverse(char* data, int n) { int k = n >> 1; repi(k) { char tmp = data[i]; data[i] = data[n - i - 1]; data[n - i - 1] = tmp; } }
void reverse(int* data, int n) { int k = n >> 1; repi(k) { int tmp = data[i]; data[i] = data[n - i - 1]; data[n - i - 1] = tmp; } }
void reverse(ll* data, int n) { int k = n >> 1; repi(k) { ll tmp = data[i]; data[i] = data[n - i - 1]; data[n - i - 1] = tmp; } }

#define _Vec(type, name) \
struct name { type* data; int size; int n; };\
void init(name* t, int size) { t->data = (type*)malloc(sizeof(type) * size); t->size = size; t->n = 0; }\
void resize(name* t) { int ns = t->size * 1.2f; t->data = (type*)realloc(t->data, sizeof(type) * ns); t->size = ns; }\
void add(name* t, type val) { if (t->n >= t->size) resize(t); int k = t->n; t->data[k] = val; t->n = k + 1; }\
void free(name* t) { free(t->data);}
_Vec(int, Veci)
_Vec(long long, Vecll)
_Vec(char*, Vecs)

#define _ispal(type, name) int name(type* a, type* b, int n){repi(n){if (a[i] != b[n - i - 1]){return 0;}}return 1;}
_ispal(int, ispali)
_ispal(char, ispalc)

#define _Pair(type, name) struct name{type x, y;}; \
int cmp_##name(const void* _a, const void* _b)\
{\
	name* a = (name*)_a;name* b = (name*)_b;\
	if (a->x < b->x) return -1;\
	else\
	{\
		if (a->x == b->x)\
		{\
			if (a->y == b->y) return 0;\
			if (a->y < b->y) return -1;\
			else return 1;\
		}\
		else\
		{\
			return 1;\
		}\
	}\
}\
void sort_##name(name* d, int n){qsort(d, n, sizeof(name), cmp_##name);}
	_Pair(int, Pairi)
	_Pair(double,Pairlf)

	int cmp_Str(const void* _a, const void* _b) { char* a = *((char**)_a); char* b = *((char**)_b); return strcmp(a, b); }
void sort_Str(char** str, int n) { qsort(str, n, sizeof(char*), cmp_Str); }

ll expmod(ll x, ll n, ll m) {
	ll ans = 1;
	for (; n;) {
		if (n & 1) ans = (ans * x) % m;
		x = (x * x) % m;
		n >>= 1;
	}
	return ans;
}

ll combmod(ll n, ll k, ll m) {
	ll ret = 1;
	ll div = 1;
	for (ll i = 0; i < k; ++i) {
		ret = (ret * (n - i) % m) % m;
		div = (div * (i + 1)) % m;
	}
	div = expmod(div, m - 2, m) % m;
	return (ret * div) % m;
}

int next_perm(int* data, int n)
{
	//find first i,i+1 where d[i]<d[i+1]
	int rootidx = -1;
	for (int i = n - 2; i >= 0; --i)
	{
		if (data[i] < data[i + 1])
		{
			rootidx = i;
			break;
		}
	}

	if (rootidx == -1) return 0;

	int ceilingidx = rootidx + 1;
	//find smallest d[x] after d[rooti] where d[x]>d[rooti]
	for (int i = rootidx + 2; i < n; ++i)
	{
		if (data[i] > data[rootidx] && data[i] < data[ceilingidx])
		{
			ceilingidx = i;
		}
	}

	swap(int, data[rootidx], data[ceilingidx]);
	sort(&data[rootidx + 1], n - rootidx - 1);
	return 1;
}
int count_digits(ll a)
{
	int k = 0;
	for (;;)
	{
		if (a == 0)break;
		k++;
		a /= 10;
	}
	return k;
}

/*
use only when val EXISTS in data
*/
int bs_exists(int* data, int n, int val)
{
	int left = 0;
	int right = n - 1;
	for (; left < right;)
	{
		int mid = (left + right + 1) >> 1;
		if (data[mid] <= val) left = mid;
		else right = mid - 1;
	}
	return right;
}

ll simple_factorial(int x)
{
	ll f = 1.0;
	repi(x)
	{
		f *= (i + 1);
	}
	return f;
}

unsigned long long djb2(char* data, int n)
{
	unsigned long long h = 5381;
	for (int i = 0; i < n; ++i) h = (h << 5) + h + data[i];
	return h;
}

struct Hashcount
{
	int* count;
	unsigned long long* keys;
	int size_bits;
};
void init(Hashcount* h, int size_bits)
{
	h->size_bits = size_bits;
	int size = 1 << h->size_bits;
	h->count = (int*)malloc(sizeof(int) * size);
	zero(h->count, size);
	h->keys = (unsigned long long*)malloc(sizeof(unsigned long long) * size);
	zero(h->keys, size);
}

int set(Hashcount* h, unsigned long long key)
{
	//knuth's golden ratio multiplicative hashing for 64-bit keys
	int index = (key * 2654435761) >> (64 - h->size_bits);
	int size = 1 << h->size_bits;
	for (int i = 0; i < size; i++)
	{
		if (h->keys[index] == key) //if key exists, overwrite data
		{
			h->count[index]++;
			return index;
		}

		if (h->keys[index] == 0) //empty spot
		{
			h->count[index] = 1;
			h->keys[index] = key;
			return index;
		}

		index++;
		index &= size - 1;
	}

	return -1;//return invalid index if data was not placed. this could be used as an indicator to resize.
}

int get(Hashcount* h, unsigned long long key)
{
	int index = (key * 2654435761) >> (64 - h->size_bits);
	int size = 1 << h->size_bits;
	for (int i = 0; i < size; i++)
	{
		if (h->keys[index] == key)//found original key
		{
			return h->count[index];
		}

		if (h->keys[index] == 0) return 0;//if you see a zero,key was never there

		index++;
		index &= size - 1;
	}
	return 0;
}
//not sure if this works
int sub(Hashcount* h, unsigned long long key)
{
	int index = (key * 2654435761) >> (64 - h->size_bits);
	int size = 1 << h->size_bits;
	for (int i = 0; i < size; i++)
	{
		if (h->keys[index] == key)//found original key
		{
			--h->count[index];
			if (h->count[index] < 0) h->count[index] = 0;
			return h->count[index];
		}

		if (h->keys[index] == 0) return 0;//if you see a zero,key was never there

		index++;
		index &= size - 1;
	}
	return 0;
}

const ll MOD  = 1e9 + 7;
/*
//proper binary search???
//tested on 1 problem it works!!!!!!!
int left = 0;
int right = n-1;
for (;;)
{
	if (left >= right)break;
	int mid = (left + right) >> 1;
	if (x <= a[mid]) right = mid;
	else left = mid+1;
}

printf("%d %d\n",right, a[right]);
*/

//------------------------------------------

//------------
int d(int* a, int n)
{
	if (n <= 1) return -1;
	if (a[0] == n)
	{
		return d(&a[1], n - 1);
	}
	else if(a[n-1] == n)
	{
		return d(a, n - 1);
	}

	repi(n) if (a[i] == n) return i;
}
int main()
{

	RUN_LOCAL("input.txt");
	int t = readi();
	rep(_t, t)
	{
		int n = readi();
		static int a[1000];
		repread(a, n);
		int x = d(a, n);
		if (x == -1) printf("NO\n");
		else printf("YES\n%d %d %d\n", x, x + 1, x + 2);
	}
	return 0;
}


/*
URL_HERE
*/
/*

*/
#ifdef _WIN32
#pragma warning(disable:4996)
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <math.h>
#include <limits.h>
#include <queue>
#include <iostream>
using namespace std;

FILE* _fin = stdin;
FILE* _fout = stdout;
#define PI 3.141592653589793238462643383279502884197169399375105820974
#define ten5p1 100001
#define ten6p1 1000001
#define ten8p1 100000001
#define ten9p1 1000000001
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define rep(var,n) for(int var=0;var<n;++var)
#define repi(n) rep(i,n)
#define repj(n) rep(j,n)
#define repi1(n) for(int i=1;i<n;++i)
#define repj1(n) for(int j=1;j<n;++j)
int _min(int a, int b) { return a <= b ? a : b; }
ll _min(ll a, ll b) { return a <= b ? a : b; }
int _max(int a, int b) { return a >= b ? a : b; }
ll _max(ll a, ll b) { return a >= b ? a : b; }
void zero(int* data, int n) { memset(data, 0, sizeof(int) * n); }
void zero(ll* data, int n) { memset(data, 0, sizeof(ll) * n); }
void zero(unsigned long long* data, int n) { memset(data, 0, sizeof(unsigned long long) * n); }
void zero(char* data, int n) { memset(data, 0, sizeof(char) * n); }
char readc() { char var; fscanf(_fin, "%c", &var); return var; }
int readi() { int var; fscanf(_fin, "%d", &var); return var; }
double readlf() { double var; fscanf(_fin, "%lf", &var); return var; }
ll readll() { ll var; fscanf(_fin, "%lld", &var); return var; }
void repread(int* data, int n) { repi(n) data[i] = readi(); }
void repread(ll* data, int n) { repi(n) data[i] = readll(); }
int reads(char* str, int maxsize)
{
	for (;;) { if (fgets(str, maxsize, _fin) == NULL) break; if (str[0] != '\n' && str[0] != '\r') break; }
	int slen = strlen(str); if (slen == 0) return 0;
	if (str[slen - 1] == '\n' || str[slen - 1] == '\r') str[--slen] = 0;
	return slen;
}

#define writec(var) fprintf(_fout,"%c",var)
#define writecsp(var) fprintf(_fout,"%c ",var)
#define writecln(var) fprintf(_fout,"%c\n",var)
#define writei(var) fprintf(_fout,"%d",var)
#define writeisp(var) fprintf(_fout,"%d ",var)
#define writellsp(var) fprintf(_fout,"%lld ",var)
#define writeiln(var) fprintf(_fout,"%d\n",var)
#define writellln(var) fprintf(_fout,"%lld\n",var)
#define writeulln(var) fprintf(_fout,"%llu\n",var)
#define writefln(var) fprintf(_fout,"%f\n",var)
#define writes(str) fprintf(_fout,"%s",str)
#define writesp() fprintf(_fout," ")
#define writeln() fprintf(_fout,"\n")
#define RUN_LOCAL(testfilename) {_fin = fopen(testfilename, "r"); if(_fin==NULL) _fin=stdin;}
#define swap(type,a, b) {type t=a;a=b;b=t;}
#define sort(data,n) std::sort(data,data+n)
//#define mod(a,b) b==0 ? 0 : a==0 ? 0 :(a>0 ? a%b : b + a % b) //what the hell is this...
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return (a / g) * b; }
void reverse(char* data, int n) { int k = n >> 1; repi(k) { char tmp = data[i]; data[i] = data[n - i - 1]; data[n - i - 1] = tmp; } }
void reverse(int* data, int n) { int k = n >> 1; repi(k) { int tmp = data[i]; data[i] = data[n - i - 1]; data[n - i - 1] = tmp; } }
void reverse(ll* data, int n) { int k = n >> 1; repi(k) { ll tmp = data[i]; data[i] = data[n - i - 1]; data[n - i - 1] = tmp; } }

#define _Vec(type, name) \
struct name { type* data; int size; int n; };\
void init(name* t, int size) { t->data = (type*)malloc(sizeof(type) * size); t->size = size; t->n = 0; }\
void resize(name* t) { int ns = t->size * 1.2f; t->data = (type*)realloc(t->data, sizeof(type) * ns); t->size = ns; }\
void add(name* t, type val) { if (t->n >= t->size) resize(t); int k = t->n; t->data[k] = val; t->n = k + 1; }\
void free(name* t) { free(t->data);}
_Vec(int, Veci)
_Vec(long long, Vecll)
_Vec(char*, Vecs)

#define _ispal(type, name) int name(type* a, type* b, int n){repi(n){if (a[i] != b[n - i - 1]){return 0;}}return 1;}
_ispal(int, ispali)
_ispal(char, ispalc)

#define _Pair(type, name) struct name{type x, y;}; \
int cmp_##name(const void* _a, const void* _b)\
{\
	name* a = (name*)_a;name* b = (name*)_b;\
	if (a->x < b->x) return -1;\
	else\
	{\
		if (a->x == b->x)\
		{\
			if (a->y == b->y) return 0;\
			if (a->y < b->y) return -1;\
			else return 1;\
		}\
		else\
		{\
			return 1;\
		}\
	}\
}\
void sort_##name(name* d, int n){qsort(d, n, sizeof(name), cmp_##name);}
	_Pair(int, Pairi)
	_Pair(double,Pairlf)

	int cmp_Str(const void* _a, const void* _b) { char* a = *((char**)_a); char* b = *((char**)_b); return strcmp(a, b); }
void sort_Str(char** str, int n) { qsort(str, n, sizeof(char*), cmp_Str); }

ll expmod(ll x, ll n, ll m) {
	ll ans = 1;
	for (; n;) {
		if (n & 1) ans = (ans * x) % m;
		x = (x * x) % m;
		n >>= 1;
	}
	return ans;
}

ll combmod(ll n, ll k, ll m) {
	ll ret = 1;
	ll div = 1;
	for (ll i = 0; i < k; ++i) {
		ret = (ret * (n - i) % m) % m;
		div = (div * (i + 1)) % m;
	}
	div = expmod(div, m - 2, m) % m;
	return (ret * div) % m;
}

int next_perm(int* data, int n)
{
	//find first i,i+1 where d[i]<d[i+1]
	int rootidx = -1;
	for (int i = n - 2; i >= 0; --i)
	{
		if (data[i] < data[i + 1])
		{
			rootidx = i;
			break;
		}
	}

	if (rootidx == -1) return 0;

	int ceilingidx = rootidx + 1;
	//find smallest d[x] after d[rooti] where d[x]>d[rooti]
	for (int i = rootidx + 2; i < n; ++i)
	{
		if (data[i] > data[rootidx] && data[i] < data[ceilingidx])
		{
			ceilingidx = i;
		}
	}

	swap(int, data[rootidx], data[ceilingidx]);
	sort(&data[rootidx + 1], n - rootidx - 1);
	return 1;
}
int count_digits(ll a)
{
	int k = 0;
	for (;;)
	{
		if (a == 0)break;
		k++;
		a /= 10;
	}
	return k;
}

/*
use only when val EXISTS in data
*/
int bs_exists(int* data, int n, int val)
{
	int left = 0;
	int right = n - 1;
	for (; left < right;)
	{
		int mid = (left + right + 1) >> 1;
		if (data[mid] <= val) left = mid;
		else right = mid - 1;
	}
	return right;
}

ll simple_factorial(int x)
{
	ll f = 1.0;
	repi(x)
	{
		f *= (i + 1);
	}
	return f;
}

unsigned long long djb2(char* data, int n)
{
	unsigned long long h = 5381;
	for (int i = 0; i < n; ++i) h = (h << 5) + h + data[i];
	return h;
}

struct Hashcount
{
	int* count;
	unsigned long long* keys;
	int size_bits;
};
void init(Hashcount* h, int size_bits)
{
	h->size_bits = size_bits;
	int size = 1 << h->size_bits;
	h->count = (int*)malloc(sizeof(int) * size);
	zero(h->count, size);
	h->keys = (unsigned long long*)malloc(sizeof(unsigned long long) * size);
	zero(h->keys, size);
}

int set(Hashcount* h, unsigned long long key)
{
	//knuth's golden ratio multiplicative hashing for 64-bit keys
	int index = (key * 2654435761) >> (64 - h->size_bits);
	int size = 1 << h->size_bits;
	for (int i = 0; i < size; i++)
	{
		if (h->keys[index] == key) //if key exists, overwrite data
		{
			h->count[index]++;
			return index;
		}

		if (h->keys[index] == 0) //empty spot
		{
			h->count[index] = 1;
			h->keys[index] = key;
			return index;
		}

		index++;
		index &= size - 1;
	}

	return -1;//return invalid index if data was not placed. this could be used as an indicator to resize.
}

int get(Hashcount* h, unsigned long long key)
{
	int index = (key * 2654435761) >> (64 - h->size_bits);
	int size = 1 << h->size_bits;
	for (int i = 0; i < size; i++)
	{
		if (h->keys[index] == key)//found original key
		{
			return h->count[index];
		}

		if (h->keys[index] == 0) return 0;//if you see a zero,key was never there

		index++;
		index &= size - 1;
	}
	return 0;
}
//not sure if this works
int sub(Hashcount* h, unsigned long long key)
{
	int index = (key * 2654435761) >> (64 - h->size_bits);
	int size = 1 << h->size_bits;
	for (int i = 0; i < size; i++)
	{
		if (h->keys[index] == key)//found original key
		{
			--h->count[index];
			if (h->count[index] < 0) h->count[index] = 0;
			return h->count[index];
		}

		if (h->keys[index] == 0) return 0;//if you see a zero,key was never there

		index++;
		index &= size - 1;
	}
	return 0;
}

const ll MOD  = 1e9 + 7;
/*
//proper binary search???
//tested on 1 problem it works!!!!!!!
int left = 0;
int right = n-1;
for (;;)
{
	if (left >= right)break;
	int mid = (left + right) >> 1;
	if (x <= a[mid]) right = mid;
	else left = mid+1;
}

printf("%d %d\n",right, a[right]);
*/

//------------------------------------------

//------------

int d(int* a, int left, int right, int n)
{
	if (n <= 2) return -1;

	if (a[left] == n)
	{
		return d(a, left + 1, right, n-1);
	}
	else if (a[right] == n)
	{
		return d(a, left, right - 1, n-1);
	}

	for (int i = left; i <= right; i++) if (a[i] == n) return i;
}
int main()
{

	RUN_LOCAL("input.txt");
	int t = readi();
	rep(_t, t)
	{
		int n = readi();
		static int a[1001];
		repread(a, n);
		int x = d(a,0, n-1, n);
		if (x == -1) printf("NO\n");
		else printf("YES\n%d %d %d\n", x, x + 1, x + 2);
	}
	return 0;
}
/*
1
5
5 3 1 2 4
*/
/*
1
4
4 1 3 2
*/


/*
URL_HERE
*/
/*

*/
#ifdef _WIN32
#pragma warning(disable:4996)
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <math.h>
#include <limits.h>
#include <queue>
#include <iostream>
using namespace std;

FILE* _fin = stdin;
FILE* _fout = stdout;
#define PI 3.141592653589793238462643383279502884197169399375105820974
#define ten5p1 100001
#define ten6p1 1000001
#define ten8p1 100000001
#define ten9p1 1000000001
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define rep(var,n) for(int var=0;var<n;++var)
#define repi(n) rep(i,n)
#define repj(n) rep(j,n)
#define repi1(n) for(int i=1;i<n;++i)
#define repj1(n) for(int j=1;j<n;++j)
int _min(int a, int b) { return a <= b ? a : b; }
ll _min(ll a, ll b) { return a <= b ? a : b; }
int _max(int a, int b) { return a >= b ? a : b; }
ll _max(ll a, ll b) { return a >= b ? a : b; }
void zero(int* data, int n) { memset(data, 0, sizeof(int) * n); }
void zero(ll* data, int n) { memset(data, 0, sizeof(ll) * n); }
void zero(unsigned long long* data, int n) { memset(data, 0, sizeof(unsigned long long) * n); }
void zero(char* data, int n) { memset(data, 0, sizeof(char) * n); }
char readc() { char var; fscanf(_fin, "%c", &var); return var; }
int readi() { int var; fscanf(_fin, "%d", &var); return var; }
double readlf() { double var; fscanf(_fin, "%lf", &var); return var; }
ll readll() { ll var; fscanf(_fin, "%lld", &var); return var; }
void repread(int* data, int n) { repi(n) data[i] = readi(); }
void repread(ll* data, int n) { repi(n) data[i] = readll(); }
int reads(char* str, int maxsize)
{
	for (;;) { if (fgets(str, maxsize, _fin) == NULL) break; if (str[0] != '\n' && str[0] != '\r') break; }
	int slen = strlen(str); if (slen == 0) return 0;
	if (str[slen - 1] == '\n' || str[slen - 1] == '\r') str[--slen] = 0;
	return slen;
}

#define writec(var) fprintf(_fout,"%c",var)
#define writecsp(var) fprintf(_fout,"%c ",var)
#define writecln(var) fprintf(_fout,"%c\n",var)
#define writei(var) fprintf(_fout,"%d",var)
#define writeisp(var) fprintf(_fout,"%d ",var)
#define writellsp(var) fprintf(_fout,"%lld ",var)
#define writeiln(var) fprintf(_fout,"%d\n",var)
#define writellln(var) fprintf(_fout,"%lld\n",var)
#define writeulln(var) fprintf(_fout,"%llu\n",var)
#define writefln(var) fprintf(_fout,"%f\n",var)
#define writes(str) fprintf(_fout,"%s",str)
#define writesp() fprintf(_fout," ")
#define writeln() fprintf(_fout,"\n")
#define RUN_LOCAL(testfilename) {_fin = fopen(testfilename, "r"); if(_fin==NULL) _fin=stdin;}
#define swap(type,a, b) {type t=a;a=b;b=t;}
#define sort(data,n) std::sort(data,data+n)
//#define mod(a,b) b==0 ? 0 : a==0 ? 0 :(a>0 ? a%b : b + a % b) //what the hell is this...
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return (a / g) * b; }
void reverse(char* data, int n) { int k = n >> 1; repi(k) { char tmp = data[i]; data[i] = data[n - i - 1]; data[n - i - 1] = tmp; } }
void reverse(int* data, int n) { int k = n >> 1; repi(k) { int tmp = data[i]; data[i] = data[n - i - 1]; data[n - i - 1] = tmp; } }
void reverse(ll* data, int n) { int k = n >> 1; repi(k) { ll tmp = data[i]; data[i] = data[n - i - 1]; data[n - i - 1] = tmp; } }

#define _Vec(type, name) \
struct name { type* data; int size; int n; };\
void init(name* t, int size) { t->data = (type*)malloc(sizeof(type) * size); t->size = size; t->n = 0; }\
void resize(name* t) { int ns = t->size * 1.2f; t->data = (type*)realloc(t->data, sizeof(type) * ns); t->size = ns; }\
void add(name* t, type val) { if (t->n >= t->size) resize(t); int k = t->n; t->data[k] = val; t->n = k + 1; }\
void free(name* t) { free(t->data);}
_Vec(int, Veci)
_Vec(long long, Vecll)
_Vec(char*, Vecs)

#define _ispal(type, name) int name(type* a, type* b, int n){repi(n){if (a[i] != b[n - i - 1]){return 0;}}return 1;}
_ispal(int, ispali)
_ispal(char, ispalc)

#define _Pair(type, name) struct name{type x, y;}; \
int cmp_##name(const void* _a, const void* _b)\
{\
	name* a = (name*)_a;name* b = (name*)_b;\
	if (a->x < b->x) return -1;\
	else\
	{\
		if (a->x == b->x)\
		{\
			if (a->y == b->y) return 0;\
			if (a->y < b->y) return -1;\
			else return 1;\
		}\
		else\
		{\
			return 1;\
		}\
	}\
}\
void sort_##name(name* d, int n){qsort(d, n, sizeof(name), cmp_##name);}
	_Pair(int, Pairi)
	_Pair(double,Pairlf)

	int cmp_Str(const void* _a, const void* _b) { char* a = *((char**)_a); char* b = *((char**)_b); return strcmp(a, b); }
void sort_Str(char** str, int n) { qsort(str, n, sizeof(char*), cmp_Str); }

ll expmod(ll x, ll n, ll m) {
	ll ans = 1;
	for (; n;) {
		if (n & 1) ans = (ans * x) % m;
		x = (x * x) % m;
		n >>= 1;
	}
	return ans;
}

ll combmod(ll n, ll k, ll m) {
	ll ret = 1;
	ll div = 1;
	for (ll i = 0; i < k; ++i) {
		ret = (ret * (n - i) % m) % m;
		div = (div * (i + 1)) % m;
	}
	div = expmod(div, m - 2, m) % m;
	return (ret * div) % m;
}

int next_perm(int* data, int n)
{
	//find first i,i+1 where d[i]<d[i+1]
	int rootidx = -1;
	for (int i = n - 2; i >= 0; --i)
	{
		if (data[i] < data[i + 1])
		{
			rootidx = i;
			break;
		}
	}

	if (rootidx == -1) return 0;

	int ceilingidx = rootidx + 1;
	//find smallest d[x] after d[rooti] where d[x]>d[rooti]
	for (int i = rootidx + 2; i < n; ++i)
	{
		if (data[i] > data[rootidx] && data[i] < data[ceilingidx])
		{
			ceilingidx = i;
		}
	}

	swap(int, data[rootidx], data[ceilingidx]);
	sort(&data[rootidx + 1], n - rootidx - 1);
	return 1;
}
int count_digits(ll a)
{
	int k = 0;
	for (;;)
	{
		if (a == 0)break;
		k++;
		a /= 10;
	}
	return k;
}

/*
use only when val EXISTS in data
*/
int bs_exists(int* data, int n, int val)
{
	int left = 0;
	int right = n - 1;
	for (; left < right;)
	{
		int mid = (left + right + 1) >> 1;
		if (data[mid] <= val) left = mid;
		else right = mid - 1;
	}
	return right;
}

ll simple_factorial(int x)
{
	ll f = 1.0;
	repi(x)
	{
		f *= (i + 1);
	}
	return f;
}

unsigned long long djb2(char* data, int n)
{
	unsigned long long h = 5381;
	for (int i = 0; i < n; ++i) h = (h << 5) + h + data[i];
	return h;
}

struct Hashcount
{
	int* count;
	unsigned long long* keys;
	int size_bits;
};
void init(Hashcount* h, int size_bits)
{
	h->size_bits = size_bits;
	int size = 1 << h->size_bits;
	h->count = (int*)malloc(sizeof(int) * size);
	zero(h->count, size);
	h->keys = (unsigned long long*)malloc(sizeof(unsigned long long) * size);
	zero(h->keys, size);
}

int set(Hashcount* h, unsigned long long key)
{
	//knuth's golden ratio multiplicative hashing for 64-bit keys
	int index = (key * 2654435761) >> (64 - h->size_bits);
	int size = 1 << h->size_bits;
	for (int i = 0; i < size; i++)
	{
		if (h->keys[index] == key) //if key exists, overwrite data
		{
			h->count[index]++;
			return index;
		}

		if (h->keys[index] == 0) //empty spot
		{
			h->count[index] = 1;
			h->keys[index] = key;
			return index;
		}

		index++;
		index &= size - 1;
	}

	return -1;//return invalid index if data was not placed. this could be used as an indicator to resize.
}

int get(Hashcount* h, unsigned long long key)
{
	int index = (key * 2654435761) >> (64 - h->size_bits);
	int size = 1 << h->size_bits;
	for (int i = 0; i < size; i++)
	{
		if (h->keys[index] == key)//found original key
		{
			return h->count[index];
		}

		if (h->keys[index] == 0) return 0;//if you see a zero,key was never there

		index++;
		index &= size - 1;
	}
	return 0;
}
//not sure if this works
int sub(Hashcount* h, unsigned long long key)
{
	int index = (key * 2654435761) >> (64 - h->size_bits);
	int size = 1 << h->size_bits;
	for (int i = 0; i < size; i++)
	{
		if (h->keys[index] == key)//found original key
		{
			--h->count[index];
			if (h->count[index] < 0) h->count[index] = 0;
			return h->count[index];
		}

		if (h->keys[index] == 0) return 0;//if you see a zero,key was never there

		index++;
		index &= size - 1;
	}
	return 0;
}

const ll MOD  = 1e9 + 7;
/*
//proper binary search???
//tested on 1 problem it works!!!!!!!
int left = 0;
int right = n-1;
for (;;)
{
	if (left >= right)break;
	int mid = (left + right) >> 1;
	if (x <= a[mid]) right = mid;
	else left = mid+1;
}

printf("%d %d\n",right, a[right]);
*/

//------------------------------------------

//------------
int d(int* a, int offset, int n)
{
	if (n <= 2) return -1;
	if (offset >= n - 1) return -1;

	if (a[offset] == n)
	{
		return d(a,offset+1, n - 1);
	}
	else if(a[offset+n-1] == n)
	{
		return d(a,offset, n - 1);
	}

	for(int i=offset;i<n;i++) if (a[i] == n) return i;
}
int main()
{

	RUN_LOCAL("input.txt");
	int t = readi();
	rep(_t, t)
	{
		int n = readi();
		static int a[1000];
		repread(a, n);
		int x = d(a,0, n);
		if (x == -1) printf("NO\n");
		else printf("YES\n%d %d %d\n", x, x + 1, x + 2);
	}
	return 0;
}
/*
1
5
5 3 1 2 4
*/
/*
1
4
4 1 3 2
*/