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

#ifdef LOCAL
#include "debug.h"
#endif

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef std::vector<vector<int> > vvi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vector<double>> vvd;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<bool> vb;
typedef vector<vb> vvb;


#define rep(i, a, b) for (int i = (int)a; i < (int)b; i++)
#define repi(i, a, b) for (int i = (int)a; i >= (int)b; i--)
#define pb push_back
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define sz(a) (int)(a.size())
#define umin(a, x) a = min(a, x)
#define umax(a, x) a = max(a, x)

ll nxt() {
	ll x; cin >> x; return x;
}

void setIO(string s) {
	#ifndef LOCAL
	ios_base::sync_with_stdio(0); cin.tie(0); 
	freopen((s+".in").c_str(),"r",stdin);
	freopen((s+".out").c_str(),"w",stdout);
	#endif
}


const int inf = 1e9;
struct SegmentTree
{	
	vi a, t;
	int n;

	SegmentTree(int n): n(n){
		a.resize(n+1, inf);
		t.resize(4*n+1, inf);
	}

	void update(int pos, int val){
		updatehelper(pos, val, 1, 1, n); //pos, val, node, left, right 
		//node is the index in the tree
	}

	int get(int l, int r){
		return gethelper(l, r, 1, 1, n);
	}

	void updatehelper(int pos, int val, int node, int left, int right){
		if(pos < left || pos > right) return;
		else if(left == right){
			a[pos] = val;
			t[node] = val;
		}
		else{
			updatehelper(pos, val, 2*node, left, (left+right)/2);
			updatehelper(pos, val, 2*node + 1, (left+right)/2 + 1, right);
			t[node] = min(t[2*node], t[2*node+1]);
		}
	}

	int gethelper(int l, int r, int node, int left, int right){
		if(r < left || l > right) return inf;
		else if( l <= left && right <= r) return t[node];
		else{
			return min(gethelper(l, r, 2*node, left, (left + right)/2), gethelper(l, r, 2*node+1, (left+right)/2 + 1, right));
		}
	}
};

void solve() {
	int n = nxt();
	SegmentTree seg(n + 2);
	vi a(n + 1); rep(i, 1, n + 1) {
		cin >> a[i];
		seg.update(i, a[i]);
	}

	vi pref_max(n + 2), suf_max(n + 2);
	map<int, int> first_occ, last_occ;

	rep(i, 1, n + 1) {
		pref_max[i] = max(pref_max[i - 1], a[i]);
		int x = suf_max[n - i + 1] = max(suf_max[n - i + 2], a[n - i + 1]);
		if (!last_occ.count(x)) {
			last_occ[x] = n - i + 1;
		}
		first_occ[x] = n - i + 1;
	}

	suf_max[0] = inf;
	vi negs = suf_max;
	rep(i, 0, sz(negs)) negs[i] = -suf_max[i];


	debug("###############");
	debug(n, a);

	debug(suf_max);
	debug(first_occ);	
	debug(last_occ);

	rep(x, 1, n - 1) {
		int cur = pref_max[x];
		int id1, id2;
		if (first_occ.count(cur)) {
			id1 = first_occ[cur];
			id2 = last_occ[cur];
			id1 = max(x + 1, id1);
			if (id2 < id1) continue;
		} else {
			continue;
		}

		int lo = max(id1 - 1, x + 1), hi = max(id2 - 1, x + 1);
		assert(id1 >= x + 1 && id1 <= id2);


		debug(x, cur, lo, hi);

		while (lo < hi) {
			int mid = (lo + hi) / 2;
			int mn = seg.get(x + 1, mid);
			if (mn > cur) {
				lo = mid + 1;
			} else {
				hi = mid;
			}
		}

		assert(lo == hi);
		if (lo >= x + 1 && lo < id2 && seg.get(x + 1, lo) == cur) {
			cout << "YES\n";
			int y = lo - x, z = n - lo;
			cout << x << " " << lo - x << " " << n - lo << "\n";

			debug(id1, id2, cur);


			assert(x >= 1 && y >= 1 && z >= 1 && x + y + z == n);
			assert(pref_max[x] == suf_max[n - z + 1] 
				&& pref_max[x] == seg.get(x + 1, x + y));
			return;
		}
	}

	cout << "NO\n";


}	
	
int32_t main(){
	// setIO("trapped");
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	cout << fixed << setprecision(10);

	int T = 1;
	cin >> T;

	for (int tc = 1; tc <= T; tc++) {
		// cout << "Case #" << tc << ": ";
		solve();
	}
}

### Prompt

Create a solution in CPP for 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
#include<bits/stdc++.h>
using namespace std;

#ifdef LOCAL
#include "debug.h"
#endif

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef std::vector<vector<int> > vvi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vector<double>> vvd;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<bool> vb;
typedef vector<vb> vvb;


#define rep(i, a, b) for (int i = (int)a; i < (int)b; i++)
#define repi(i, a, b) for (int i = (int)a; i >= (int)b; i--)
#define pb push_back
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define sz(a) (int)(a.size())
#define umin(a, x) a = min(a, x)
#define umax(a, x) a = max(a, x)

ll nxt() {
	ll x; cin >> x; return x;
}

void setIO(string s) {
	#ifndef LOCAL
	ios_base::sync_with_stdio(0); cin.tie(0); 
	freopen((s+".in").c_str(),"r",stdin);
	freopen((s+".out").c_str(),"w",stdout);
	#endif
}


const int inf = 1e9;
struct SegmentTree
{	
	vi a, t;
	int n;

	SegmentTree(int n): n(n){
		a.resize(n+1, inf);
		t.resize(4*n+1, inf);
	}

	void update(int pos, int val){
		updatehelper(pos, val, 1, 1, n); //pos, val, node, left, right 
		//node is the index in the tree
	}

	int get(int l, int r){
		return gethelper(l, r, 1, 1, n);
	}

	void updatehelper(int pos, int val, int node, int left, int right){
		if(pos < left || pos > right) return;
		else if(left == right){
			a[pos] = val;
			t[node] = val;
		}
		else{
			updatehelper(pos, val, 2*node, left, (left+right)/2);
			updatehelper(pos, val, 2*node + 1, (left+right)/2 + 1, right);
			t[node] = min(t[2*node], t[2*node+1]);
		}
	}

	int gethelper(int l, int r, int node, int left, int right){
		if(r < left || l > right) return inf;
		else if( l <= left && right <= r) return t[node];
		else{
			return min(gethelper(l, r, 2*node, left, (left + right)/2), gethelper(l, r, 2*node+1, (left+right)/2 + 1, right));
		}
	}
};

void solve() {
	int n = nxt();
	SegmentTree seg(n + 2);
	vi a(n + 1); rep(i, 1, n + 1) {
		cin >> a[i];
		seg.update(i, a[i]);
	}

	vi pref_max(n + 2), suf_max(n + 2);
	map<int, int> first_occ, last_occ;

	rep(i, 1, n + 1) {
		pref_max[i] = max(pref_max[i - 1], a[i]);
		int x = suf_max[n - i + 1] = max(suf_max[n - i + 2], a[n - i + 1]);
		if (!last_occ.count(x)) {
			last_occ[x] = n - i + 1;
		}
		first_occ[x] = n - i + 1;
	}

	suf_max[0] = inf;
	vi negs = suf_max;
	rep(i, 0, sz(negs)) negs[i] = -suf_max[i];


	debug("###############");
	debug(n, a);

	debug(suf_max);
	debug(first_occ);	
	debug(last_occ);

	rep(x, 1, n - 1) {
		int cur = pref_max[x];
		int id1, id2;
		if (first_occ.count(cur)) {
			id1 = first_occ[cur];
			id2 = last_occ[cur];
			id1 = max(x + 1, id1);
			if (id2 < id1) continue;
		} else {
			continue;
		}

		int lo = max(id1 - 1, x + 1), hi = max(id2 - 1, x + 1);
		assert(id1 >= x + 1 && id1 <= id2);


		debug(x, cur, lo, hi);

		while (lo < hi) {
			int mid = (lo + hi) / 2;
			int mn = seg.get(x + 1, mid);
			if (mn > cur) {
				lo = mid + 1;
			} else {
				hi = mid;
			}
		}

		assert(lo == hi);
		if (lo >= x + 1 && lo < id2 && seg.get(x + 1, lo) == cur) {
			cout << "YES\n";
			int y = lo - x, z = n - lo;
			cout << x << " " << lo - x << " " << n - lo << "\n";

			debug(id1, id2, cur);


			assert(x >= 1 && y >= 1 && z >= 1 && x + y + z == n);
			assert(pref_max[x] == suf_max[n - z + 1] 
				&& pref_max[x] == seg.get(x + 1, x + y));
			return;
		}
	}

	cout << "NO\n";


}	
	
int32_t main(){
	// setIO("trapped");
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	cout << fixed << setprecision(10);

	int T = 1;
	cin >> T;

	for (int tc = 1; tc <= T; tc++) {
		// cout << "Case #" << tc << ": ";
		solve();
	}
}

```