#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int a[N], b[N], c[N];
int main() {
  ios::sync_with_stdio(false);
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    vector<pair<int, int> > z;
    scanf("%d", &n);
    memset(b, 0, sizeof(b));
    memset(c, 0, sizeof(c));
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    int l = n + 1, r = 0;
    for (int i = 1; i <= n; i++) {
      if (b[a[i]]) break;
      l = min(l, a[i]);
      r = max(r, a[i]);
      if (l == 1 && r == i) c[i] = 1;
      b[a[i]] = 1;
    }
    l = n + 1;
    r = 0;
    memset(b, 0, sizeof(b));
    for (int i = n; i >= 1; i--) {
      if (b[a[i]]) break;
      l = min(l, a[i]);
      r = max(r, a[i]);
      if (l == 1 && r == n - i + 1 && c[i - 1]) z.push_back({i - 1, n - i + 1});
      b[a[i]] = 1;
    }
    printf("%d\n", z.size());
    for (int i = 0; i < z.size(); i++)
      printf("%d %d\n", z[i].first, z[i].second);
  }
  return 0;
}
