#include <stdio.h>

#define N	200000
#define INF	0x3f3f3f3f

int min(int a, int b) { return a < b ? a : b; }
int max(int a, int b) { return a > b ? a : b; }

int main() {
	int t;

	scanf("%d", &t);
	while (t--) {
		static int aa[N], pp[N], qq[N];
		int n, i, j, mn, l, m, r;

		scanf("%d", &n);
		for (i = 0; i < n; i++) {
			scanf("%d", &aa[i]);
			pp[i] = qq[i] = aa[i];
		}
		for (i = 1; i < n; i++)
			pp[i] = max(pp[i], pp[i - 1]);
		for (i = n - 2; i >= 0; i--)
			qq[i] = max(qq[i], qq[i + 1]);
		l = m = r = 0, mn = INF;
		for (i = n - 2, j = n - 1; i >= 0 && j < n; i--) {
			while (j < n && qq[j] > pp[i])
				mn = min(mn, aa[j++]);
			if (j < n && qq[j] == pp[i]) {
				if (i + 1 < j && mn == pp[i]) {
					l = i + 1, m = j - i - 1, r = n - j;
					break;
				}
				if (j + 1 < n && qq[j + 1] == pp[i] && min(mn, aa[j]) == pp[i]) {
					l = i + 1, m = j - i, r = n - j - 1;
					break;
				}
			}
			if (i + 1 < j)
				mn = min(mn, aa[i]);
			else
				j--;
		}
		if (l != 0) {
			printf("YES\n");
			printf("%d %d %d\n", l, m, r);
		} else
			printf("NO\n");
	}
	return 0;
}
