#include <bits/stdc++.h>
using namespace std;
inline long long in() {
  long long s = 0, f = 0, ch = getchar();
  while (!isdigit(ch)) f |= ch == '-', ch = getchar();
  while (isdigit(ch)) s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
  return f ? -s : s;
}
const long long N = 1e6 + 5;
const long long mod = 1e9 + 7;
const long long inf = ~(1ULL << 63);
long long n, m, k;
long long a[N], b[N], f[N];
long long c[N];
long long qp(long long a, long long b) {
  long long sum = 1;
  while (b) {
    if (b & 1) sum = sum * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return sum;
}
bool flag[N];
long long p[N], tot;
long long find(long long x) { return x == f[x] ? x : f[x] = find(f[x]); }
long long judge(long long l) {
  vector<long long> s1, s2;
  for (long long i = 1; i <= (l); ++i) {
    s1.push_back(a[i]);
  }
  for (long long i = l + 1; i <= (n); ++i) {
    s2.push_back(a[i]);
  }
  sort(s1.begin(), s1.end());
  sort(s2.begin(), s2.end());
  if (s1.back() == s1.size() && s2.back() == s2.size()) {
    long long tot1 = unique(s1.begin(), s1.end()) - s1.begin();
    long long tot2 = unique(s2.begin(), s2.end()) - s2.begin();
    if (s1.back() == tot1 && s2.back() == tot2) return 1;
  }
  return 0;
}
void work() {
  n = in();
  long long mx = 0;
  vector<pair<long long, long long> > ans;
  for (long long i = 1; i <= (n); ++i) {
    a[i] = in();
    mx = max(mx, a[i]);
  }
  if (judge(mx)) {
    ans.push_back({mx, n - mx});
  }
  if (judge(n - mx)) {
    ans.push_back({n - mx, mx});
  }
  if (mx * 2 == n && ans.size()) ans.pop_back();
  cout << ans.size() << "\n";
  for (auto i : ans) {
    cout << i.first << " " << i.second << "\n";
  }
}
signed main() {
  for (long long _ = in(); _; --_) work();
  return 0;
}
