#include <bits/stdc++.h>

using namespace std;
int n;
const int MAX = 2e5+10;
int a[MAX];
int lp[MAX<<2],rp[MAX<<2],mi[MAX<<2];
int lMax[MAX],rMax[MAX];
void pushup(int i){
    mi[i] = min(mi[i<<1],mi[i<<1|1]);
}
void build(int l,int r,int i){
    lp[i] = l;
    rp[i] = r;
    if(l == r){
        mi[i] = a[l];
        return;
    }
    int mid = (l+r)>>1;
    build(l,mid,i<<1);
    build(mid+1,r,i<<1|1);
    pushup(i);
}
int query(int l,int r,int i){
    if(l <= lp[i] && rp[i] <= r){
        return mi[i];
    }
    int mid = (lp[i]+rp[i]) >> 1;//左区间的右边界
    int res = INT_MAX;
    if(l <= mid){
        res = min(res,query(l,r,i<<1));
    }
    if(mid < r){
        res = min(res,query(l,r,i<<1|1));
    }
    return res;
}
void init(){
    build(1,n,1);
    lMax[1] = a[1];
    for(int i = 2;i <= n;i += 1){
        lMax[i] = max(lMax[i-1],a[i]);
    }
    rMax[n] = a[n];
    for(int i = n-1;i >= 1;i -= 1){
        rMax[i] = max(rMax[i+1],a[i]);
    }
}
void solve(){
    init();
    for(int i = 1;i + 2 <= n;i += 1){
        int l = i+1,r = n-1;
        while(l <= r){
            int mid = l + (r-l)/2;
            int Min = query(i+1,mid,1);
            if(lMax[i] < Min || rMax[mid+1] > lMax[i]){
                l = mid + 1;
            }else if(lMax[i] > Min || rMax[mid+1] < lMax[i]){
                r = mid - 1;
            }else{
                cout << "YES" << endl;
                cout << i << " " << mid-i << " " << n-mid << endl;
                return;
            }
        }
    }
    cout << "NO" << endl;


}
int main(void){
    int T;
    cin >> T;
    while(T--){
        cin >> n;
        for(int i=1;i<=n;i+=1){
            cin >> a[i];
        }
        solve();

    }


    return 0;
}