#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
using namespace std;
inline long long read() {
  long long x = 0, neg = 1;
  char op = getchar();
  while (!isdigit(op)) {
    if (op == '-') neg = -1;
    op = getchar();
  }
  while (isdigit(op)) {
    x = 10 * x + op - '0';
    op = getchar();
  }
  return neg * x;
}
inline void print(long long x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}
const long long maxn = 2e5 + 10;
long long n, a[maxn], memo[maxn];
bool check(long long mx) {
  memset(memo, 0, sizeof(memo));
  for (long long i = 1; i <= mx; i++) {
    if (a[i] > mx) return false;
    memo[a[i]]++;
  }
  for (long long i = 1; i <= mx; i++)
    if (memo[i] != 1) return false;
  memset(memo, 0, sizeof(memo));
  long long k = n - mx;
  for (long long i = n; i >= n - k + 1; i--) {
    if (a[i] > k) return false;
    memo[a[i]]++;
  }
  for (long long i = 1; i <= k; i++)
    if (memo[i] != 1) return false;
  return true;
}
vector<pair<long long, long long> > ans;
signed main() {
  long long t;
  t = read();
  while (t-- > 0) {
    n = read();
    memset(memo, 0, sizeof(memo));
    for (long long i = 1; i <= n; i++) {
      a[i] = read();
      memo[a[i]]++;
    }
    bool v = true;
    long long mx = 1;
    for (long long i = 1; i <= n; i++) {
      if (memo[i] > 2) {
        v = false;
        break;
      }
      if (memo[i] == 2) {
        mx = max(i, mx);
      }
    }
    if (!v) {
      cout << 0 << endl;
      continue;
    }
    long long k1 = min(mx, n - mx), k2 = max(mx, n - mx);
    ans.clear();
    if (check(k1)) ans.push_back({k1, k2});
    if (k1 != k2 && check(k2)) ans.push_back({k2, k1});
    cout << ans.size() << endl;
    for (auto it : ans) {
      cout << it.first << " " << it.second << endl;
    }
  }
  return 0;
}
