#include<iostream>
#include <string>
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#define ll long long int
#define ld long double
#define pb push_back
#define endl "\n"
#define mp make_pair
#define sz(v) (int)(v.size())
#define len(s) (ll)(s.length())
#define M 1000000007
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for(ll i=a;i<=b;i+=c)
#define inarr(arr,n); for(ll i=0;i<n;i++) cin >> arr[i];
#define outarr(arr,n); for(ll i=0;i<n;i++) cout<<arr[i]<<" ";
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const ll inf = 9e18;
const ld pi = 2*acos(0.0); 
using namespace std;
ll power(ll a,ll n) 
{
    if(n==0){
        return 1;
    }
    ll p=power(a,n/2) % M;
    p = (p * p) % M;
    if (n%2==1)
    {
        p=(p*a)%M;
    }
    return p;
}
ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
}
const int N=1e6+5;
vector <ll> sieve(N,0); 
void si() 
{
    sieve[1]=1;
    for(int i=2;i<N;i++){
        if(sieve[i]==0){
            sieve[i]=1;
            for(int j=2*i;j<N;j+=i){
                sieve[j]=i;
            }
        }
    }
}
vector <ll> a(200055);
vector <ll> st(5*100000,0);
void build(ll n){//Input mein jo n ki  value that is parameter
        for(int i=0;i<n;i++){
            st[n+i]=a[i];
        }
        for(int i=n-1;i>=0;i--){
            st[i]=min(st[2*i],st[2*i+1]);
        }
}
void update(ll n,ll pos,ll val){ //pos is the index jispe update hai and val is the value
        st[n+pos]=val;
        pos+=n;
        while(pos>1){
            st[pos>>1]=min(st[pos],st[pos^1]);
            pos=pos>>1;
        }
}
ll query(ll n,ll l,ll r){ //l and r are range for query of the form [l,r) matlab r is not included
    l+=n;r+=n;
    ll ans=1e9+15;
    while(l<r){
        if(l&1){
            ans=min(ans,st[l++]);
        }                             //yahan jo bhi operation karna ho karlena
        if(r&1){
            ans=min(ans,st[--r]);
        }
        l=l>>1;
        r=r>>1;
    }
    return ans;
}
int main(){
    ios;
    int t;
    cin>>t;
    ll t1=t;
    while(t--){
       int n;
       cin>>n;
       inarr(a,n);
       build(n);
       map <ll,vector <ll> >m;
       for(int i=0;i<n;i++){
           m[a[i]].pb(i);
       }
       vector <ll> max1(n,0);
       max1[0]=a[0];
       for(int i=1;i<n;i++){
           max1[i]=max(max1[i-1],a[i]);
       }
       vector <ll> max2(n,0);
       max2[n-1]=a[n-1];
       for(int i=n-2;i>=0;i--){
           max2[i]=max(max2[i+1],a[i]);
       }
       ll L=-1,R=-1;
       for (auto itr:m){
           vector <ll> v=itr.second;
           ll val=itr.first;
           if(sz(v)>=3){
               for(int i=1;i<sz(v)-1;i++){
                   ll l=v[i]+1;
                   ll r=n-1;
                   ll x=-1,y=-1;
                   while(l<=r){
                       ll mid=(l+r)/2;
                       ll z=query(n,v[i],mid+1);
                       if(z!=val){
                           ll zz=query(n,v[i],mid);
                           if(zz==val){
                               if(a[mid-1]==val){
                                   if((mid-1)==v[i]){
                                       x=mid;
                                       break;
                                   }
                                   else{
                                       x=mid-1;
                                       break;
                                   }
                               }
                               x=mid;
                               break;
                           }
                           else{
                               r=mid-1;
                           }
                       }
                       else{
                           if(mid==n-1){
                               x=mid;
                               break;
                           }
                           if(a[mid]==val && max2[mid]==val){
                                x=mid;
                                break;
                            }
                           l=mid+1;
                       }
                   }
                   l=1;
                   r=v[i];
                   while(l<=r){
                       ll mid=(l+r)/2;
                       ll z=query(n,mid,v[i]+1);
                       if(z!=val){
                           l=mid+1;
                       }
                       else{
                           if(mid==0){
                               y=mid;
                               break;
                           }
                           if(max1[mid-1]==val){
                               y=mid;
                               break;
                           }
                           ll zz=query(n,mid-1,v[i]+1);
                           if(zz==val){
                               r=mid-1;
                           }
                           else{
                               y=mid;
                               break;
                           }
                       }
                   }
                   if(y!=-1 && y>=0 && y<n-1 && a[y]==val && y!=v[i] && max1[y]==val){
                       y+=1;
                   }
                   swap(x,y);
                   ll z=query(n,x,y);
                   if(x==0 || z!=val){
                       continue;
                   }
                   if(max1[x-1]==val && max2[y]==val && x!=-1 && y!=-1 && x>0 && x<n && y>0 && y<n){
                       L=x;
                       R=y;
                       break;
                   }
               }
           }
           if(L!=-1 && R!=-1){
               break;
           }
       }
       string z1="";
       for(int i=0;i<n;i++){
           string z2=to_string(a[i]);
           z1+=z2;
           z1+=',';
       }
       /*if(t1-t==132){
           cout<<z1<<endl;
           continue;
       }*/
       if(L==-1 && R==-1){
           cout<<"NO"<<endl;
           continue;
       }
        cout<<"YES"<<endl;
        cout<<L<<" "<<R-L<<" "<<n-R<<endl;
        for(int i=0;i<=n;i++){
            a[i]=0;
        }
        for(int i=0;i<=2*n+5;i++){
            st[i]=0;
        }
    }
    return 0;
}
### Prompt

Develop a solution in cpp to the problem described below:

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
#include<iostream>
#include <string>
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
#define ll long long int
#define ld long double
#define pb push_back
#define endl "\n"
#define mp make_pair
#define sz(v) (int)(v.size())
#define len(s) (ll)(s.length())
#define M 1000000007
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for(ll i=a;i<=b;i+=c)
#define inarr(arr,n); for(ll i=0;i<n;i++) cin >> arr[i];
#define outarr(arr,n); for(ll i=0;i<n;i++) cout<<arr[i]<<" ";
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const ll inf = 9e18;
const ld pi = 2*acos(0.0); 
using namespace std;
ll power(ll a,ll n) 
{
    if(n==0){
        return 1;
    }
    ll p=power(a,n/2) % M;
    p = (p * p) % M;
    if (n%2==1)
    {
        p=(p*a)%M;
    }
    return p;
}
ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
}
const int N=1e6+5;
vector <ll> sieve(N,0); 
void si() 
{
    sieve[1]=1;
    for(int i=2;i<N;i++){
        if(sieve[i]==0){
            sieve[i]=1;
            for(int j=2*i;j<N;j+=i){
                sieve[j]=i;
            }
        }
    }
}
vector <ll> a(200055);
vector <ll> st(5*100000,0);
void build(ll n){//Input mein jo n ki  value that is parameter
        for(int i=0;i<n;i++){
            st[n+i]=a[i];
        }
        for(int i=n-1;i>=0;i--){
            st[i]=min(st[2*i],st[2*i+1]);
        }
}
void update(ll n,ll pos,ll val){ //pos is the index jispe update hai and val is the value
        st[n+pos]=val;
        pos+=n;
        while(pos>1){
            st[pos>>1]=min(st[pos],st[pos^1]);
            pos=pos>>1;
        }
}
ll query(ll n,ll l,ll r){ //l and r are range for query of the form [l,r) matlab r is not included
    l+=n;r+=n;
    ll ans=1e9+15;
    while(l<r){
        if(l&1){
            ans=min(ans,st[l++]);
        }                             //yahan jo bhi operation karna ho karlena
        if(r&1){
            ans=min(ans,st[--r]);
        }
        l=l>>1;
        r=r>>1;
    }
    return ans;
}
int main(){
    ios;
    int t;
    cin>>t;
    ll t1=t;
    while(t--){
       int n;
       cin>>n;
       inarr(a,n);
       build(n);
       map <ll,vector <ll> >m;
       for(int i=0;i<n;i++){
           m[a[i]].pb(i);
       }
       vector <ll> max1(n,0);
       max1[0]=a[0];
       for(int i=1;i<n;i++){
           max1[i]=max(max1[i-1],a[i]);
       }
       vector <ll> max2(n,0);
       max2[n-1]=a[n-1];
       for(int i=n-2;i>=0;i--){
           max2[i]=max(max2[i+1],a[i]);
       }
       ll L=-1,R=-1;
       for (auto itr:m){
           vector <ll> v=itr.second;
           ll val=itr.first;
           if(sz(v)>=3){
               for(int i=1;i<sz(v)-1;i++){
                   ll l=v[i]+1;
                   ll r=n-1;
                   ll x=-1,y=-1;
                   while(l<=r){
                       ll mid=(l+r)/2;
                       ll z=query(n,v[i],mid+1);
                       if(z!=val){
                           ll zz=query(n,v[i],mid);
                           if(zz==val){
                               if(a[mid-1]==val){
                                   if((mid-1)==v[i]){
                                       x=mid;
                                       break;
                                   }
                                   else{
                                       x=mid-1;
                                       break;
                                   }
                               }
                               x=mid;
                               break;
                           }
                           else{
                               r=mid-1;
                           }
                       }
                       else{
                           if(mid==n-1){
                               x=mid;
                               break;
                           }
                           if(a[mid]==val && max2[mid]==val){
                                x=mid;
                                break;
                            }
                           l=mid+1;
                       }
                   }
                   l=1;
                   r=v[i];
                   while(l<=r){
                       ll mid=(l+r)/2;
                       ll z=query(n,mid,v[i]+1);
                       if(z!=val){
                           l=mid+1;
                       }
                       else{
                           if(mid==0){
                               y=mid;
                               break;
                           }
                           if(max1[mid-1]==val){
                               y=mid;
                               break;
                           }
                           ll zz=query(n,mid-1,v[i]+1);
                           if(zz==val){
                               r=mid-1;
                           }
                           else{
                               y=mid;
                               break;
                           }
                       }
                   }
                   if(y!=-1 && y>=0 && y<n-1 && a[y]==val && y!=v[i] && max1[y]==val){
                       y+=1;
                   }
                   swap(x,y);
                   ll z=query(n,x,y);
                   if(x==0 || z!=val){
                       continue;
                   }
                   if(max1[x-1]==val && max2[y]==val && x!=-1 && y!=-1 && x>0 && x<n && y>0 && y<n){
                       L=x;
                       R=y;
                       break;
                   }
               }
           }
           if(L!=-1 && R!=-1){
               break;
           }
       }
       string z1="";
       for(int i=0;i<n;i++){
           string z2=to_string(a[i]);
           z1+=z2;
           z1+=',';
       }
       /*if(t1-t==132){
           cout<<z1<<endl;
           continue;
       }*/
       if(L==-1 && R==-1){
           cout<<"NO"<<endl;
           continue;
       }
        cout<<"YES"<<endl;
        cout<<L<<" "<<R-L<<" "<<n-R<<endl;
        for(int i=0;i<=n;i++){
            a[i]=0;
        }
        for(int i=0;i<=2*n+5;i++){
            st[i]=0;
        }
    }
    return 0;
}
```