#ifdef LOCAL
#pragma warning(disable:4996)
#pragma warning(disable:4244)
#pragma warning(disable:4554)
#define gets gets_s

#endif
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<stack>
#include<queue>
#include<cmath>
#include<vector>
#include<string>
#include<cctype>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<bitset>
#include<assert.h>
#include<unordered_map>
#include<ctime>
#define ll long long
#define cl(a,x) memset((a),(x),sizeof(a))
#define lson 2*i
#define rson 2*i+1
#define sf scanf
#define ull unsigned long long
#define lowbit(x) (x)&(-x)
#define pii pair<int,int>
#define pll pair<long long,long long>
#define ti tree[i]
#define mp make_pair
ll q_pow(ll x, ll n, ll mod) { ll ret = 1; while (n) { if (n & 1) ret = x * ret%mod; x = x * x%mod; n >>= 1; }return ret; }
ll __gcd(ll x, ll y) { if (!y) return x; return __gcd(y, x%y); }
ll getbit(ll now) { int cnt = 0; while (now) { cnt++; now -= lowbit(now); }return cnt; }
int dx[] = { -1,1,0,0 };//上下左右
int dy[] = { 0,0,-1,1 };//
using namespace std;
const ll INF = 0x3f3f3f3f;
const ll IINF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 2e5 + 10;
const int maxm = 3e3 + 800;
const double eps = 1e-9;
const double pi = 3.1415926;
const int mod = !1 ? 998244353 : 1e9 + 7;

int n, m, a[maxn + 555];

struct Segment_min {
	///一些情况下的被卡常，区间单点更新操作
	struct node {
		int l, r;
		ll sum;
		int len() {
			return this->r - this->l + 1;
		}
	};
	node tree[maxn * 4 + 555];

	void push_up(int i) {
		ti.sum = min(tree[2 * i].sum, tree[i * 2 + 1].sum);
	}
	void build(int i, int l, int r) {
		ti.l = l, ti.r = r;
		if (l == r) {
			ti.sum = a[l];
			return;
		}
		int mid = l + r >> 1;
		build(2 * i, l, mid);
		build(2 * i + 1, mid + 1, r);
		push_up(i);
	}
	void update(int i, int pos, int val) {
		if (ti.l == ti.r and ti.l == pos) {
			ti.sum += val;
			return;
		}

		int mid = ti.l + ti.r >> 1;
		if (pos <= mid) update(2 * i, pos, val);
		if (pos > mid) update(2 * i + 1, pos, val);
		push_up(i);
	}
	ll query(int i, int l, int r) {
		if (ti.l >= l && ti.r <= r) {
			return ti.sum;
		}
		int mid = ti.l + ti.r >> 1;
		ll ans = INF;

		if (l <= mid) ans = min(ans, query(2 * i, l, r));
		if (r > mid) ans = min(ans, query(2 * i + 1, l, r));
		return ans;
	}
};

struct Segment_max {
	///一些情况下的被卡常，区间单点更新操作
	struct node {
		int l, r;
		ll sum;
		int len() {
			return this->r - this->l + 1;
		}
	};
	node tree[maxn * 4 + 555];
	void push_up(int i) {
		ti.sum = max(tree[2 * i].sum, tree[i * 2 + 1].sum);
	}
	void build(int i, int l, int r) {
		ti.l = l, ti.r = r;
		if (l == r) {
			ti.sum = a[l];
			return;
		}
		int mid = l + r >> 1;
		build(2 * i, l, mid);
		build(2 * i + 1, mid + 1, r);
		push_up(i);
	}
	void update(int i, int pos, int val) {
		if (ti.l == ti.r and ti.l == pos) {
			ti.sum += val;
			return;
		}

		int mid = ti.l + ti.r >> 1;
		if (pos <= mid) update(2 * i, pos, val);
		if (pos > mid) update(2 * i + 1, pos, val);
		push_up(i);
	}
	ll query(int i, int l, int r) {
		if (ti.l >= l && ti.r <= r) {
			return ti.sum;
		}
		int mid = ti.l + ti.r >> 1;
		ll ans = -INF;

		if (l <= mid) ans = max(ans, query(2 * i, l, r));
		if (r > mid) ans = max(ans, query(2 * i + 1, l, r));
		return ans;
	}
};

Segment_max max_tree;
Segment_min min_tree;

void solve() {
	sf("%d", &n);
	for (int i = 1; i <= n; i++)
		sf("%d", &a[i]);

	min_tree.build(1, 1, n);
	max_tree.build(1, 1, n);
	int ansa = 0, pos = 0;

	int ri_maxnum = 0;
	int maxnum = a[1];
	for (int i = 2; i < n; i++) {
		maxnum = max(maxnum, a[i - 1]);
		int le = i - 1, ri = n - 1;//起点，终点
		int mid = 0;
		while (le + 1 < ri) {
			mid = (le + ri) >> 1;
			int minnum = min_tree.query(1, i, mid);
			if (minnum > maxnum) le = mid;
			else if (minnum == maxnum) {
				ri_maxnum = max_tree.query(1, mid + 1, n);
				if (minnum < ri_maxnum) le = mid;
				else ri = mid;
			}
			else ri = mid;
		}
		
		///cerr << i << " " << maxnum << ' ' << min_tree.query(1, i, ri) << ' ' << le << endl;
		if (max_tree.query(1, ri + 1, n) == min_tree.query(1, i, ri) and min_tree.query(1, i, ri) == maxnum) {
			pos = ri;
			ansa = i;
		}
	}

	if (pos == 0) {
		printf("NO\n"); return;
	}
	int num1 = ansa - 1;
	int num3 = n - pos;
	int num2 = n - num1 - num3;
	
	printf("YES\n");
	printf("%d %d %d\n", num1, num2, num3);
}

signed main(int argc, char *argv[]) {
	if (argc == 2 && strcmp("-debug", argv[1]) == 0) {
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	}

	int t;
	sf("%d", &t);
	while (t--) {
		solve();
	}

	return 0;
}

### Prompt

Please provide a CPP coded solution 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
#ifdef LOCAL
#pragma warning(disable:4996)
#pragma warning(disable:4244)
#pragma warning(disable:4554)
#define gets gets_s

#endif
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<stack>
#include<queue>
#include<cmath>
#include<vector>
#include<string>
#include<cctype>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<bitset>
#include<assert.h>
#include<unordered_map>
#include<ctime>
#define ll long long
#define cl(a,x) memset((a),(x),sizeof(a))
#define lson 2*i
#define rson 2*i+1
#define sf scanf
#define ull unsigned long long
#define lowbit(x) (x)&(-x)
#define pii pair<int,int>
#define pll pair<long long,long long>
#define ti tree[i]
#define mp make_pair
ll q_pow(ll x, ll n, ll mod) { ll ret = 1; while (n) { if (n & 1) ret = x * ret%mod; x = x * x%mod; n >>= 1; }return ret; }
ll __gcd(ll x, ll y) { if (!y) return x; return __gcd(y, x%y); }
ll getbit(ll now) { int cnt = 0; while (now) { cnt++; now -= lowbit(now); }return cnt; }
int dx[] = { -1,1,0,0 };//上下左右
int dy[] = { 0,0,-1,1 };//
using namespace std;
const ll INF = 0x3f3f3f3f;
const ll IINF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 2e5 + 10;
const int maxm = 3e3 + 800;
const double eps = 1e-9;
const double pi = 3.1415926;
const int mod = !1 ? 998244353 : 1e9 + 7;

int n, m, a[maxn + 555];

struct Segment_min {
	///一些情况下的被卡常，区间单点更新操作
	struct node {
		int l, r;
		ll sum;
		int len() {
			return this->r - this->l + 1;
		}
	};
	node tree[maxn * 4 + 555];

	void push_up(int i) {
		ti.sum = min(tree[2 * i].sum, tree[i * 2 + 1].sum);
	}
	void build(int i, int l, int r) {
		ti.l = l, ti.r = r;
		if (l == r) {
			ti.sum = a[l];
			return;
		}
		int mid = l + r >> 1;
		build(2 * i, l, mid);
		build(2 * i + 1, mid + 1, r);
		push_up(i);
	}
	void update(int i, int pos, int val) {
		if (ti.l == ti.r and ti.l == pos) {
			ti.sum += val;
			return;
		}

		int mid = ti.l + ti.r >> 1;
		if (pos <= mid) update(2 * i, pos, val);
		if (pos > mid) update(2 * i + 1, pos, val);
		push_up(i);
	}
	ll query(int i, int l, int r) {
		if (ti.l >= l && ti.r <= r) {
			return ti.sum;
		}
		int mid = ti.l + ti.r >> 1;
		ll ans = INF;

		if (l <= mid) ans = min(ans, query(2 * i, l, r));
		if (r > mid) ans = min(ans, query(2 * i + 1, l, r));
		return ans;
	}
};

struct Segment_max {
	///一些情况下的被卡常，区间单点更新操作
	struct node {
		int l, r;
		ll sum;
		int len() {
			return this->r - this->l + 1;
		}
	};
	node tree[maxn * 4 + 555];
	void push_up(int i) {
		ti.sum = max(tree[2 * i].sum, tree[i * 2 + 1].sum);
	}
	void build(int i, int l, int r) {
		ti.l = l, ti.r = r;
		if (l == r) {
			ti.sum = a[l];
			return;
		}
		int mid = l + r >> 1;
		build(2 * i, l, mid);
		build(2 * i + 1, mid + 1, r);
		push_up(i);
	}
	void update(int i, int pos, int val) {
		if (ti.l == ti.r and ti.l == pos) {
			ti.sum += val;
			return;
		}

		int mid = ti.l + ti.r >> 1;
		if (pos <= mid) update(2 * i, pos, val);
		if (pos > mid) update(2 * i + 1, pos, val);
		push_up(i);
	}
	ll query(int i, int l, int r) {
		if (ti.l >= l && ti.r <= r) {
			return ti.sum;
		}
		int mid = ti.l + ti.r >> 1;
		ll ans = -INF;

		if (l <= mid) ans = max(ans, query(2 * i, l, r));
		if (r > mid) ans = max(ans, query(2 * i + 1, l, r));
		return ans;
	}
};

Segment_max max_tree;
Segment_min min_tree;

void solve() {
	sf("%d", &n);
	for (int i = 1; i <= n; i++)
		sf("%d", &a[i]);

	min_tree.build(1, 1, n);
	max_tree.build(1, 1, n);
	int ansa = 0, pos = 0;

	int ri_maxnum = 0;
	int maxnum = a[1];
	for (int i = 2; i < n; i++) {
		maxnum = max(maxnum, a[i - 1]);
		int le = i - 1, ri = n - 1;//起点，终点
		int mid = 0;
		while (le + 1 < ri) {
			mid = (le + ri) >> 1;
			int minnum = min_tree.query(1, i, mid);
			if (minnum > maxnum) le = mid;
			else if (minnum == maxnum) {
				ri_maxnum = max_tree.query(1, mid + 1, n);
				if (minnum < ri_maxnum) le = mid;
				else ri = mid;
			}
			else ri = mid;
		}
		
		///cerr << i << " " << maxnum << ' ' << min_tree.query(1, i, ri) << ' ' << le << endl;
		if (max_tree.query(1, ri + 1, n) == min_tree.query(1, i, ri) and min_tree.query(1, i, ri) == maxnum) {
			pos = ri;
			ansa = i;
		}
	}

	if (pos == 0) {
		printf("NO\n"); return;
	}
	int num1 = ansa - 1;
	int num3 = n - pos;
	int num2 = n - num1 - num3;
	
	printf("YES\n");
	printf("%d %d %d\n", num1, num2, num3);
}

signed main(int argc, char *argv[]) {
	if (argc == 2 && strcmp("-debug", argv[1]) == 0) {
		freopen("in.txt", "r", stdin);
		freopen("out.txt", "w", stdout);
	}

	int t;
	sf("%d", &t);
	while (t--) {
		solve();
	}

	return 0;
}

```