#pragma GCC optimize("O3")
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <ctime>
#include <cstring>
#include <stack>
#include <ctime>
#include <iomanip>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

//#include <ext/pb_ds/assoc_container.hpp>

#define fi first
#define se second
#define th third

#define en "\n"
#define sqrt(n) sqrt((long double) n)
#define ALL(c) (c).begin() , (c).end()
#define MOD 998244353
#define MEM0(a) memset(a,0,sizeof(a))
#define FAST() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define FILES(name) name!=""?freopen(name".in","r",stdin),freopen(name".out","w",stdout):0
#define elif else if
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define SZ(a) ((long long)((a).size()))
#define WHAT_IS(x) cerr << #x << " is " << x << en
#define TIMER (clock()*1.0/CLOCKS_PER_SEC)
#define int long long


using namespace std;

template<class A, class B, class C> struct triple { A first; B second; C third;
    bool operator<(const triple& t) const { if (first != t.first) return first < t.first; if (second != t.second) return second < t.second; return third < t.third; } };


typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> seti;
typedef long double ld;
typedef pair<ld, ld> pdd;
typedef triple<int, int, int> tiii;


const ld EPS=0.000000001;
const ld INFD32=1000000000;
const ll INF64=1000000000000000000;
const ll INF32=1000000000;
const ll one=1;

bool iss_ll(ll __1,ll __2){ return INF64/__1>=__2;}
bool equal(double _1,double _2){ return (abs(_1-_2)<EPS);}
bool iss_sqr(int &__1){ll __2=sqrt(__1); return __2*__2==__1;};
bool iss_prime(ll __1){for (int i=2; i*i<=__1; ++i) if (!(__1%i)) return 0; return 1;}
int gcd(int __1,int __2){ while (__1 && __2) if (__1>__2)  __1=__1%__2; else __2=__2%__1; return __1+__2;}
int lcm(int __1,int __2){ return __1*__2/(gcd(__1, __2));}
int sq_cube(ll x){if (x==0) return 1;int l=0,r=2e6;while (l+1<r){int m=(l+r)/2;if (m*m*m>x) r=m;else l=m;}return l;}
ll bp(ll a,ll b,ll md){ll res=1;while (b) {if (b&1) res*=a;a*=a;a%=md;res%=md;b>>=1;}return res;}
ll inv(ll x,ll md) {return bp(x, md - 2, md);}


void update_by_mod(int &x,int md){
    x%=md;
    if (x<0) x+=md;
}

void update_by_mod(int &x,int &y,int md){
    update_by_mod(x,md);
    update_by_mod(y,md);
}
void update_by_mod(int &x,int &y,int &z,int md){
    update_by_mod(x,md);
    update_by_mod(y,md);
    update_by_mod(z,md);
}
void update_by_mod(int &x,int &y,int &z,int &a,int md){
    update_by_mod(x,md);
    update_by_mod(y,md);
    update_by_mod(z,md);
    update_by_mod(a,md);
}

vector <int> z_function(string &s) {
    int n = SZ(s);
    vector<int> ans(n, 0);
    int l = 0, r = 0;
    for (int i = 1; i < n; ++i) {
        ans[i] = min(r - i + 1, ans[i - l]);
        while (ans[i] + i < n && s[ans[i]] == s[i + ans[i]]){
            ++ans[i];
        }
        if (i + ans[i] - 1 > r) {
            l = i, r = i + ans[i] - 1;
        }
        r = max(r, i);
    }
    return ans;
}

template <class T>
T sqr(T x){
    return x*x;
}

/*

#define maxN 500500

int fact[maxN],rfact[maxN];

void bld(int md) {
    fact[0] = 1;
    for (int i = 1; i < maxN; ++i) {
        fact[i] = fact[i - 1] * i % md;
    }
    rfact[maxN - 1] = bp(fact[maxN - 1], md - 2, md);
    for (int i = maxN - 2; i >= 0; --i) {
        rfact[i] = rfact[i + 1] * (i + 1) % md;
    }
}

int C(int n,int k,int md) {
    if (k > n) return 0;
    int res = fact[n];
    res *= rfact[k];
    res %= md;
    res *= rfact[n - k];
    res %= md;
    return res;
}

*/


#define maxN 200500

int arr[maxN];

int tree[4*maxN];

void bld(int v,int l,int r){
    if (l==r){
        tree[v]=arr[l];
        return;
    }
    int m=(l+r)>>1;
    bld(v<<1,l,m);
    bld(v<<1|1,m+1,r);
    tree[v]=min(tree[v<<1],tree[v<<1|1]);
}
int q(int v,int l, int r, int L, int R){
    if (l==L && r==R){
        return tree[v];
    }
    int m=(l+r)>>1;
    if (R<=m) return q(v<<1,l,m,L,R);
    if (L>m) return q(v<<1|1,m+1,r,L,R);
    return min(q(v<<1,l,m,L,m),q(v<<1|1,m+1,r,m+1,R));
}

int n;

int maxi_pr[maxN];

int maxi_suf[maxN];

int f1(int x){
    if (arr[1]>x) return 0;
    int l=1,r=n+1;
    while (l+1<r){
        int m=(l+r)>>1;
        if (maxi_pr[m]>x) r=m;
        else l=m;
    }
    return l;
}

int f2(int x){
    if (arr[n]>x) return 0;
    int l=0,r=n;
    while (l+1<r){
        int m=(l+r)>>1;
        if (maxi_suf[m]>x) l=m;
        else r=m;
    }
    return r;
}

bool f(int p1,int p2,int i){
    if (p2>n) return 0;
    if (p1+1>p2-1) return 0;
    if (p1<1) return 0;
    return maxi_pr[p1]==i && q(1,1,n,p1+1,p2-1)==i && maxi_suf[p2]==i;
}


unordered_map<int,vi> MP;


void solve() {
    cin>>n;
    seti S;
    MP.clear();
    int maxi=-100;
    int cn=0;
    for (int i=1; i<=n; ++i){
        cin>>arr[i];
        if (maxi<arr[i]) maxi=arr[i],cn=0;
        if (maxi==arr[i]) ++cn;
        MP[arr[i]].push_back(i);
    }
    for (int i=1; i<=n; ++i){
        maxi_pr[i]=max(maxi_pr[i-1],arr[i]);
    }
    maxi_suf[n+1]=0;
    for (int i=n; i>0; --i){
        maxi_suf[i]=max(maxi_suf[i+1],arr[i]);
    }
    if (cn>=3){
        cn=0;
        for (int i=1; i<=n; ++i){
            if (arr[i]==maxi) ++cn;
            if (cn==2){
                cout<<"YES"<<en;
                cout<<i-1<<" "<<1<<" "<<n-i<<en;
                return;
            }
        }
    }
    bld(1,1,n);
    for (auto j:MP){
        for (int i=1; i<j.second.size()-1; ++i){
            int pos=j.second[i];
            int p1=f1(j.first);
            int p2=f2(j.first);
            p1=min(p1,pos-1);
            p2=max(p2,pos+1);
            if (f(p1,p2,j.first)){
                cout<<"YES"<<en;
                cout<<p1<<" "<<p2-p1-1<<" "<<n-p2+1<<en;
                return;
            }
        }
    }
    cout<<"NO"<<en;
}



signed main(void) {
    //look at the end
    //srand(666);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cerr<<TIMER<<en;
    int t = 1;
    cin >> t;
    for (int i = 1; i <= t; ++i) {
        //cout<<"Case #"<<i<<": ";
        solve();
    }
//cerr<<TIMER<<en;
    return 0;
}
//check special cases for example (n==1)
//check size  arrays
### Prompt

Your task is to create a Cpp solution to the following problem:

You are given an array a consisting of n integers.

Let min(l, r) be the minimum value among a_l, a_{l + 1}, …, a_r and max(l, r) be the maximum value among a_l, a_{l + 1}, …, a_r.

Your task is to choose three positive (greater than 0) integers x, y and z such that:

  * x + y + z = n; 
  * max(1, x) = min(x + 1, x + y) = max(x + y + 1, n). 



In other words, you have to split the array a into three consecutive non-empty parts that cover the whole array and the maximum in the first part equals the minimum in the second part and equals the maximum in the third part (or determine it is impossible to find such a partition).

Among all such triples (partitions), you can choose any.

You have to answer t independent test cases.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 2 ⋅ 10^4) — the number of test cases. Then t test cases follow.

The first line of the test case contains one integer n (3 ≤ n ≤ 2 ⋅ 10^5) — the length of a.

The second line of the test case contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^9), where a_i is the i-th element of a.

It is guaranteed that the sum of n does not exceed 2 ⋅ 10^5 (∑ n ≤ 2 ⋅ 10^5).

Output

For each test case, print the answer: NO in the only line if there is no such partition of a that satisfies the conditions from the problem statement. Otherwise, print YES in the first line and three integers x, y and z (x + y + z = n) in the second line.

If there are several answers, you can print any.

Example

Input


6
11
1 2 3 3 3 4 4 3 4 2 1
8
2 9 1 7 3 9 4 1
9
2 1 4 2 4 3 3 1 2
7
4 2 1 1 4 1 4
5
1 1 1 1 1
7
4 3 4 3 3 3 4


Output


YES
6 1 4
NO
YES
2 5 2
YES
4 1 2
YES
1 1 3
YES
2 1 4

### Response

```cpp
#pragma GCC optimize("O3")
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <iostream>
#include <iterator>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <fstream>
#include <ctime>
#include <cstring>
#include <stack>
#include <ctime>
#include <iomanip>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

//#include <ext/pb_ds/assoc_container.hpp>

#define fi first
#define se second
#define th third

#define en "\n"
#define sqrt(n) sqrt((long double) n)
#define ALL(c) (c).begin() , (c).end()
#define MOD 998244353
#define MEM0(a) memset(a,0,sizeof(a))
#define FAST() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define FILES(name) name!=""?freopen(name".in","r",stdin),freopen(name".out","w",stdout):0
#define elif else if
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define SZ(a) ((long long)((a).size()))
#define WHAT_IS(x) cerr << #x << " is " << x << en
#define TIMER (clock()*1.0/CLOCKS_PER_SEC)
#define int long long


using namespace std;

template<class A, class B, class C> struct triple { A first; B second; C third;
    bool operator<(const triple& t) const { if (first != t.first) return first < t.first; if (second != t.second) return second < t.second; return third < t.third; } };


typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> seti;
typedef long double ld;
typedef pair<ld, ld> pdd;
typedef triple<int, int, int> tiii;


const ld EPS=0.000000001;
const ld INFD32=1000000000;
const ll INF64=1000000000000000000;
const ll INF32=1000000000;
const ll one=1;

bool iss_ll(ll __1,ll __2){ return INF64/__1>=__2;}
bool equal(double _1,double _2){ return (abs(_1-_2)<EPS);}
bool iss_sqr(int &__1){ll __2=sqrt(__1); return __2*__2==__1;};
bool iss_prime(ll __1){for (int i=2; i*i<=__1; ++i) if (!(__1%i)) return 0; return 1;}
int gcd(int __1,int __2){ while (__1 && __2) if (__1>__2)  __1=__1%__2; else __2=__2%__1; return __1+__2;}
int lcm(int __1,int __2){ return __1*__2/(gcd(__1, __2));}
int sq_cube(ll x){if (x==0) return 1;int l=0,r=2e6;while (l+1<r){int m=(l+r)/2;if (m*m*m>x) r=m;else l=m;}return l;}
ll bp(ll a,ll b,ll md){ll res=1;while (b) {if (b&1) res*=a;a*=a;a%=md;res%=md;b>>=1;}return res;}
ll inv(ll x,ll md) {return bp(x, md - 2, md);}


void update_by_mod(int &x,int md){
    x%=md;
    if (x<0) x+=md;
}

void update_by_mod(int &x,int &y,int md){
    update_by_mod(x,md);
    update_by_mod(y,md);
}
void update_by_mod(int &x,int &y,int &z,int md){
    update_by_mod(x,md);
    update_by_mod(y,md);
    update_by_mod(z,md);
}
void update_by_mod(int &x,int &y,int &z,int &a,int md){
    update_by_mod(x,md);
    update_by_mod(y,md);
    update_by_mod(z,md);
    update_by_mod(a,md);
}

vector <int> z_function(string &s) {
    int n = SZ(s);
    vector<int> ans(n, 0);
    int l = 0, r = 0;
    for (int i = 1; i < n; ++i) {
        ans[i] = min(r - i + 1, ans[i - l]);
        while (ans[i] + i < n && s[ans[i]] == s[i + ans[i]]){
            ++ans[i];
        }
        if (i + ans[i] - 1 > r) {
            l = i, r = i + ans[i] - 1;
        }
        r = max(r, i);
    }
    return ans;
}

template <class T>
T sqr(T x){
    return x*x;
}

/*

#define maxN 500500

int fact[maxN],rfact[maxN];

void bld(int md) {
    fact[0] = 1;
    for (int i = 1; i < maxN; ++i) {
        fact[i] = fact[i - 1] * i % md;
    }
    rfact[maxN - 1] = bp(fact[maxN - 1], md - 2, md);
    for (int i = maxN - 2; i >= 0; --i) {
        rfact[i] = rfact[i + 1] * (i + 1) % md;
    }
}

int C(int n,int k,int md) {
    if (k > n) return 0;
    int res = fact[n];
    res *= rfact[k];
    res %= md;
    res *= rfact[n - k];
    res %= md;
    return res;
}

*/


#define maxN 200500

int arr[maxN];

int tree[4*maxN];

void bld(int v,int l,int r){
    if (l==r){
        tree[v]=arr[l];
        return;
    }
    int m=(l+r)>>1;
    bld(v<<1,l,m);
    bld(v<<1|1,m+1,r);
    tree[v]=min(tree[v<<1],tree[v<<1|1]);
}
int q(int v,int l, int r, int L, int R){
    if (l==L && r==R){
        return tree[v];
    }
    int m=(l+r)>>1;
    if (R<=m) return q(v<<1,l,m,L,R);
    if (L>m) return q(v<<1|1,m+1,r,L,R);
    return min(q(v<<1,l,m,L,m),q(v<<1|1,m+1,r,m+1,R));
}

int n;

int maxi_pr[maxN];

int maxi_suf[maxN];

int f1(int x){
    if (arr[1]>x) return 0;
    int l=1,r=n+1;
    while (l+1<r){
        int m=(l+r)>>1;
        if (maxi_pr[m]>x) r=m;
        else l=m;
    }
    return l;
}

int f2(int x){
    if (arr[n]>x) return 0;
    int l=0,r=n;
    while (l+1<r){
        int m=(l+r)>>1;
        if (maxi_suf[m]>x) l=m;
        else r=m;
    }
    return r;
}

bool f(int p1,int p2,int i){
    if (p2>n) return 0;
    if (p1+1>p2-1) return 0;
    if (p1<1) return 0;
    return maxi_pr[p1]==i && q(1,1,n,p1+1,p2-1)==i && maxi_suf[p2]==i;
}


unordered_map<int,vi> MP;


void solve() {
    cin>>n;
    seti S;
    MP.clear();
    int maxi=-100;
    int cn=0;
    for (int i=1; i<=n; ++i){
        cin>>arr[i];
        if (maxi<arr[i]) maxi=arr[i],cn=0;
        if (maxi==arr[i]) ++cn;
        MP[arr[i]].push_back(i);
    }
    for (int i=1; i<=n; ++i){
        maxi_pr[i]=max(maxi_pr[i-1],arr[i]);
    }
    maxi_suf[n+1]=0;
    for (int i=n; i>0; --i){
        maxi_suf[i]=max(maxi_suf[i+1],arr[i]);
    }
    if (cn>=3){
        cn=0;
        for (int i=1; i<=n; ++i){
            if (arr[i]==maxi) ++cn;
            if (cn==2){
                cout<<"YES"<<en;
                cout<<i-1<<" "<<1<<" "<<n-i<<en;
                return;
            }
        }
    }
    bld(1,1,n);
    for (auto j:MP){
        for (int i=1; i<j.second.size()-1; ++i){
            int pos=j.second[i];
            int p1=f1(j.first);
            int p2=f2(j.first);
            p1=min(p1,pos-1);
            p2=max(p2,pos+1);
            if (f(p1,p2,j.first)){
                cout<<"YES"<<en;
                cout<<p1<<" "<<p2-p1-1<<" "<<n-p2+1<<en;
                return;
            }
        }
    }
    cout<<"NO"<<en;
}



signed main(void) {
    //look at the end
    //srand(666);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cerr<<TIMER<<en;
    int t = 1;
    cin >> t;
    for (int i = 1; i <= t; ++i) {
        //cout<<"Case #"<<i<<": ";
        solve();
    }
//cerr<<TIMER<<en;
    return 0;
}
//check special cases for example (n==1)
//check size  arrays
```