#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#define vvi             vector<vector<int>>
#define ld              long double
#define mod             1000000007
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vpii            vector<pair<int,int>>
#define all(x)          x.begin(),x.end()
#define sz(a)           (int)(a.size())
#define vi              vector<int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define SS              stringstream
#define db(...)         __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << '\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

// const int dirx[4] = {0, 0, -1, 1};
// const int diry[4] = { -1, 1, 0, 0};

// 0 -> l, 1 - > r, 2 -> u , 3 -> down

void FASTIO()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

const int mxN = 2e6 + 100;
int n, m, k, q, ans;
int a[mxN];
int treeMax[mxN];
int treeMin[mxN];
string s;

void updateMax(int node, int start, int end, int idx, int val)
{
    if(start == end)
    {
        // Leaf node
        a[idx] = val;
        treeMax[node] = val;
    }
    else
    {
        int mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
        {
            // If idx is in the left child, recurse on the left child
            updateMax(2*node, start, mid, idx, val);
        }
        else
        {
            // if idx is in the right child, recurse on the right child
            updateMax(2*node+1, mid+1, end, idx, val);
        }
        // Internal node will have the sum of both of its children
        treeMax[node] = max(treeMax[2*node], treeMax[2*node+1]);
    }
}

int queryMax(int node, int start, int end, int l, int r)
{
    if(r < start or end < l)
    {
        // range represented by a node is completely outside the given range
        return -1e18;
    }
    if(l <= start and end <= r)
    {
        // range represented by a node is completely inside the given range
        return treeMax[node];
    }
    // range represented by a node is partially inside and partially outside the given range
    int mid = (start + end) / 2;
    int p1 = queryMax(2*node, start, mid, l, r);
    int p2 = queryMax(2*node+1, mid+1, end, l, r);
    return max(p1, p2);
}

void updateMin(int node, int start, int end, int idx, int val)
{
    if(start == end)
    {
        // Leaf node
        a[idx] = val;
        treeMin[node] = val;
    }
    else
    {
        int mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
        {
            // If idx is in the left child, recurse on the left child
            updateMin(2*node, start, mid, idx, val);
        }
        else
        {
            // if idx is in the right child, recurse on the right child
            updateMin(2*node+1, mid+1, end, idx, val);
        }
        // Internal node will have the sum of both of its children
        treeMin[node] = min(treeMin[2*node], treeMin[2*node+1]);
    }
}

int queryMin(int node, int start, int end, int l, int r)
{
    if(r < start or end < l)
    {
        // range represented by a node is completely outside the given range
        return 1e18;
    }
    if(l <= start and end <= r)
    {
        // range represented by a node is completely inside the given range
        return treeMin[node];
    }
    // range represented by a node is partially inside and partially outside the given range
    int mid = (start + end) / 2;
    int p1 = queryMin(2*node, start, mid, l, r);
    int p2 = queryMin(2*node+1, mid+1, end, l, r);
    return min(p1, p2);
}

int findmin(int s, int e)
{
	if(s == e)
		return a[s];
	return queryMin(1,1,n,s,e);
}

int findmax(int s, int e)
{
	if(s == e)
		return a[s];
	return queryMax(1,s,e,1,n);
}

void test_case()
{
	cin >> n;

	for(int i = 1; i <= n; i++)
	{
		cin >> a[i];
		treeMin[i] = treeMax[i] = 0;
	}

	for(int i = 1; i <= n; i++)
	{
		updateMin(1,1,n,i,a[i]);
	}

	map<int, vi> index;

	int mx = 0;

	for(int i = n; i >= 2; i--)
	{
		mx = max(mx, a[i]);
		index[mx].pb(i - 1);
	}

	mx = 0;

	for(int i = 1; i <= n - 2; i++)
	{
		mx = max(mx, a[i]);
		if(index.find(mx) == index.end())
			continue;

		int s = max(i + 1, index[mx].back());
		int e = index[mx][0];

		while(s <= e)
		{
			int mid = (s + e) >> 1;
			if(findmin(i + 1, mid) == mx)
			{
				// db(mid, mx);
				cout << "YES\n" << i << " " << mid - (i + 1) + 1 << " " << n - (mid + 1) + 1 << '\n';
				return;
			}
			else if(findmin(i + 1, mid) > mx)
			{
				s = mid + 1;
			}
			else
			{
				e = mid - 1;
			}
		}
	}

	cout << "NO\n";
	return;
}

int32_t main()
{
	FASTIO();

	int t;
	t = 1;
	cin >> t;

	for (int i = 1; i <= t; i++)
	{
		// cout << "Case #" << i << ": ";
		test_case();
	}
	return 0;
}
### 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
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#define vvi             vector<vector<int>>
#define ld              long double
#define mod             1000000007
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vpii            vector<pair<int,int>>
#define all(x)          x.begin(),x.end()
#define sz(a)           (int)(a.size())
#define vi              vector<int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define SS              stringstream
#define db(...)         __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << '\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}

// const int dirx[4] = {0, 0, -1, 1};
// const int diry[4] = { -1, 1, 0, 0};

// 0 -> l, 1 - > r, 2 -> u , 3 -> down

void FASTIO()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

const int mxN = 2e6 + 100;
int n, m, k, q, ans;
int a[mxN];
int treeMax[mxN];
int treeMin[mxN];
string s;

void updateMax(int node, int start, int end, int idx, int val)
{
    if(start == end)
    {
        // Leaf node
        a[idx] = val;
        treeMax[node] = val;
    }
    else
    {
        int mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
        {
            // If idx is in the left child, recurse on the left child
            updateMax(2*node, start, mid, idx, val);
        }
        else
        {
            // if idx is in the right child, recurse on the right child
            updateMax(2*node+1, mid+1, end, idx, val);
        }
        // Internal node will have the sum of both of its children
        treeMax[node] = max(treeMax[2*node], treeMax[2*node+1]);
    }
}

int queryMax(int node, int start, int end, int l, int r)
{
    if(r < start or end < l)
    {
        // range represented by a node is completely outside the given range
        return -1e18;
    }
    if(l <= start and end <= r)
    {
        // range represented by a node is completely inside the given range
        return treeMax[node];
    }
    // range represented by a node is partially inside and partially outside the given range
    int mid = (start + end) / 2;
    int p1 = queryMax(2*node, start, mid, l, r);
    int p2 = queryMax(2*node+1, mid+1, end, l, r);
    return max(p1, p2);
}

void updateMin(int node, int start, int end, int idx, int val)
{
    if(start == end)
    {
        // Leaf node
        a[idx] = val;
        treeMin[node] = val;
    }
    else
    {
        int mid = (start + end) / 2;
        if(start <= idx and idx <= mid)
        {
            // If idx is in the left child, recurse on the left child
            updateMin(2*node, start, mid, idx, val);
        }
        else
        {
            // if idx is in the right child, recurse on the right child
            updateMin(2*node+1, mid+1, end, idx, val);
        }
        // Internal node will have the sum of both of its children
        treeMin[node] = min(treeMin[2*node], treeMin[2*node+1]);
    }
}

int queryMin(int node, int start, int end, int l, int r)
{
    if(r < start or end < l)
    {
        // range represented by a node is completely outside the given range
        return 1e18;
    }
    if(l <= start and end <= r)
    {
        // range represented by a node is completely inside the given range
        return treeMin[node];
    }
    // range represented by a node is partially inside and partially outside the given range
    int mid = (start + end) / 2;
    int p1 = queryMin(2*node, start, mid, l, r);
    int p2 = queryMin(2*node+1, mid+1, end, l, r);
    return min(p1, p2);
}

int findmin(int s, int e)
{
	if(s == e)
		return a[s];
	return queryMin(1,1,n,s,e);
}

int findmax(int s, int e)
{
	if(s == e)
		return a[s];
	return queryMax(1,s,e,1,n);
}

void test_case()
{
	cin >> n;

	for(int i = 1; i <= n; i++)
	{
		cin >> a[i];
		treeMin[i] = treeMax[i] = 0;
	}

	for(int i = 1; i <= n; i++)
	{
		updateMin(1,1,n,i,a[i]);
	}

	map<int, vi> index;

	int mx = 0;

	for(int i = n; i >= 2; i--)
	{
		mx = max(mx, a[i]);
		index[mx].pb(i - 1);
	}

	mx = 0;

	for(int i = 1; i <= n - 2; i++)
	{
		mx = max(mx, a[i]);
		if(index.find(mx) == index.end())
			continue;

		int s = max(i + 1, index[mx].back());
		int e = index[mx][0];

		while(s <= e)
		{
			int mid = (s + e) >> 1;
			if(findmin(i + 1, mid) == mx)
			{
				// db(mid, mx);
				cout << "YES\n" << i << " " << mid - (i + 1) + 1 << " " << n - (mid + 1) + 1 << '\n';
				return;
			}
			else if(findmin(i + 1, mid) > mx)
			{
				s = mid + 1;
			}
			else
			{
				e = mid - 1;
			}
		}
	}

	cout << "NO\n";
	return;
}

int32_t main()
{
	FASTIO();

	int t;
	t = 1;
	cin >> t;

	for (int i = 1; i <= t; i++)
	{
		// cout << "Case #" << i << ": ";
		test_case();
	}
	return 0;
}
```