#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long res = 1;
  for (long long i = 0; i < b; ++i) {
    res *= a;
  }
  return res;
}
long long logx(long long base, long long num) {
  int cnt = 0;
  while (num != 1) {
    num /= base;
    ++cnt;
  }
  return cnt;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
void print(vector<long long> a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i] << ' ';
  }
  cout << "\n";
}
vector<long long> inp(int n) {
  vector<long long> a;
  long long x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long x;
  cin >> x;
  while (x--) {
    long long y;
    cin >> y;
    long long a[y], b[y];
    for (int i = 0; i < y; i++) {
      cin >> a[i];
    }
    map<long long, long long> m;
    for (int i = 0; i < y; i++) {
      m[a[i]]++;
    }
    long long k = 0;
    for (auto i : m) {
      if (i.second == 1) {
        break;
      } else {
        k++;
      }
    }
    if (k == 0) {
      cout << 0 << "\n";
      continue;
    }
    long long k1 = m.size();
    if (k + k1 != y) {
      cout << 0 << "\n";
    } else {
      vector<long long> v, v1;
      vector<pair<long long, long long> > v3;
      for (long long i = 0; i < k1; i++) {
        v.push_back(a[i]);
      }
      for (long long i = k1; i < y; i++) {
        v1.push_back(a[i]);
      }
      sort(v.begin(), v.end());
      sort(v1.begin(), v1.end());
      long long ans = 0;
      long long flg = 0, flg1 = 0;
      if (v[0] != 1) {
        flg = 1;
      }
      for (int i = 0; i < v.size() - 1; i++) {
        if (v[i + 1] != v[i] + 1) {
          flg = 1;
          break;
        }
      }
      if (v1[0] != 1) {
        flg1 = 1;
      }
      for (int i = 0; i < v1.size() - 1; i++) {
        if (v1[i + 1] != v1[i] + 1) {
          flg1 = 1;
          break;
        }
      }
      if (flg == 0 && flg1 == 0) {
        ans++;
        v3.push_back(make_pair(k1, k));
      }
      v.clear();
      v1.clear();
      for (long long i = 0; i < k; i++) {
        v.push_back(a[i]);
      }
      for (long long i = k; i < y; i++) {
        v1.push_back(a[i]);
      }
      sort(v.begin(), v.end());
      sort(v1.begin(), v1.end());
      flg = 0, flg1 = 0;
      if (v[0] != 1) {
        flg = 1;
      }
      for (int i = 0; i < v.size() - 1; i++) {
        if (v[i + 1] != v[i] + 1) {
          flg = 1;
          break;
        }
      }
      if (v1[0] != 1) {
        flg1 = 1;
      }
      for (int i = 0; i < v1.size() - 1; i++) {
        if (v1[i + 1] != v1[i] + 1) {
          flg1 = 1;
          break;
        }
      }
      if (flg == 0 && flg1 == 0) {
        ans++;
        v3.push_back(make_pair(k, k1));
      }
      if (k == k1) {
        if (ans > 0) {
          cout << 1 << "\n";
          cout << k << " " << k1 << "\n";
          continue;
        }
      }
      cout << ans << "\n";
      for (int i = 0; i < v3.size(); i++) {
        cout << v3[i].first << " " << v3[i].second << "\n";
      }
    }
  }
}
