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

Solution (in CPP):

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

template <class T>
struct RangeMaximumQuery {
  vector<T> arr;
  vector<vector<T>> table;

  RangeMaximumQuery(const vector<T>& a) : arr(a) {
    precompute();
  };

  void precompute() {
    int N = arr.size();
    int logN = log2(N);
    table = vector<vector<T>>(N, vector<T>(logN + 1));

    // Bottom up DP. Base cases.
    for (int i = 0; i < N; ++i) {
      table[i][0] = arr[i];
    }

    // Recursion. Loop over length (i.e. j) should be first.
    for (int j = 1; j < logN + 1; ++j) {
      for (int i = 0; i + (1 << j) - 1 < N; ++i) {
        table[i][j] = max(table[i][j - 1],
                          table[i + (1 << (j - 1))][j - 1]);
      }
    }
  }

  int query(int left, int right) {
    if (left == right) return table[left][0];
    int k = log2(right - left);
    T answer = max(table[left][k],
                   table[right - (1 << k) + 1][k]);
    return answer;
  }
};

template <class T>
struct RangeMinimumQuery {
  vector<T> arr;
  vector<vector<T>> table;

  RangeMinimumQuery(const vector<T>& a) : arr(a) {
    precompute();
  };

  void precompute() {
    int N = arr.size();
    int logN = log2(N);
    table = vector<vector<T>>(N, vector<T>(logN + 1));

    // Bottom up DP. Base cases.
    for (int i = 0; i < N; ++i) {
      table[i][0] = arr[i];
    }

    // Recursion. Loop over length (i.e. j) should be first.
    for (int j = 1; j < logN + 1; ++j) {
      for (int i = 0; i + (1 << j) - 1 < N; ++i) {
        table[i][j] = min(table[i][j - 1],
                          table[i + (1 << (j - 1))][j - 1]);
      }
    }
  }

  int query(int left, int right) {
    if (left == right) return table[left][0];
    int k = log2(right - left);
    T answer = min(table[left][k],
                   table[right - (1 << k) + 1][k]);
    return answer;
  }
};

struct Interval {
  int left;
  int right;
};

// Return -1 if no overlap
int findOverlappingPoint(const Interval& a, const Interval& b) {
  if (a.right < b.left || b.right < a.left) {
    return - 1;
  } else {
    // There is overlap. At least 2 of the 4 endpoints should overlap.
    if (a.left >= b.left && a.left <= b.right) {
      return a.left;
    }
    if (a.right >= b.left && a.right <= b.right) {
      return a.right;
    }
    if (b.left >= a.left && b.left <= a.right) {
      return b.left;
    }
    if (b.right >= a.left && b.right <= a.right) {
      return b.right;
    }     
  }
}

void solve() {
  int N;
  cin >> N;
  vector<int> values(N);
  for (int i = 0; i < N; ++i) {
    cin >> values[i];
  }

  RangeMaximumQuery<int> rmaxq(values);
  RangeMinimumQuery<int> rminq(values);

  for (int x = 0; x < N - 2; ++x) {
    const int value_x = rmaxq.query(0, x);

    // cout << "------x: " << x << endl;

    // Find smallest y such that prefix_min(x + 1, y) == value_x
    int lo = x + 1;
    int hi = N - 2;
    while (lo < hi) {
      const int mid = lo + (hi - lo) / 2;
      if (rminq.query(x + 1, mid) > value_x) {
        lo = mid + 1;
      } else {
        hi = mid;
      }
    }
    const int y1 = lo;

    if (rminq.query(x + 1, y1) != value_x) {
      continue;
    }

    // Find largest y such that prefix_min(x + 1, y) == value_x
    lo = x + 1;
    hi = N - 2;
    while (lo < hi) {
      const int mid = lo + (hi - lo + 1) / 2;
      if (rminq.query(x + 1, mid) >= value_x) {
        lo = mid;
      } else {
        hi = mid - 1;
      }
    }
    const int y2 = lo;
    assert(rminq.query(x + 1, y2) == value_x);


    // Find smallest z such that prefix_max(z, N - 1) == value_x
    lo = 0;
    hi = N - 1;
    while (lo < hi) {
      const int mid = lo + (hi - lo) / 2;
      if (rmaxq.query(mid, N - 1) > value_x) {
        lo = mid + 1;
      } else {
        hi = mid;
      }
    }
    const int z1 = lo;
    if (rmaxq.query(z1, N - 1) != value_x) {
      continue;
    }

    // Find largest z such that prefix_min(z, N - 1) == value_x
    lo = 0;
    hi = N - 1;
    while (lo < hi) {
      const int mid = lo + (hi - lo + 1) / 2;
      if (rmaxq.query(mid, N - 1) >= value_x) {
        lo = mid;
      } else {
        hi = mid - 1;
      }
    }
    const int z2 = lo;
    assert(rmaxq.query(z2, N - 1) == value_x);

    // cout << y1 << " " << y2 << " " << z1 << " " << z2 << endl;
    // Find point y such that y E [y1, y2] and y + 1 E [z1, z2]
    // So find point y such that y E [y1, y2] and y E [z1 - 1, z2 - 1]
    const int y = findOverlappingPoint({ y1, y2 }, { z1 - 1, z2 - 1 });
    if (y != -1) {
      // Overlap found.
      cout << "YES" << endl;
      cout << x + 1 << " " << y - x << " " << N - 1 - y << endl;
      return;
    }
  }
  cout << "NO" << endl;
}

int main() {
  int num_cases;
  cin >> num_cases;
  for (int i = 0; i < num_cases; ++i) {
    solve();
  }
}