#include <bits/stdc++.h>
using namespace std;
long long int modularExponentiation(long long int x, long long int y,
                                    long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> v(n);
    long long int _max1 = 0;
    long long int _max2 = 0;
    map<long long int, long long int> mp;
    set<long long int> s;
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      _max1 = max(v[i], _max1);
      mp[v[i]]++;
      if (mp[v[i]] == 2) _max2 = max(v[i], _max2);
    }
    long long int flag = 1;
    for (int i = 1; i <= _max1; i++) {
      if (mp.count(i) == 0 && mp[i] == 0)
        flag = 0;
      else
        mp[i]--;
    }
    for (int i = 1; i <= _max2; i++) {
      if (mp.count(i) == 0 && mp[i] == 0)
        flag = 0;
      else
        mp[i]--;
    }
    for (auto e : mp) {
      if (e.second) flag = 0;
    }
    if (flag == 0 || _max1 + _max2 != n) {
      cout << 0 << endl;
    } else {
      flag = 1;
      vector<pair<long long int, long long int> > ans;
      vector<long long int> c(n, 0);
      for (int i = 0; i < n; i++) {
        s.insert(v[i]);
        c[v[i]]++;
        if (s.size() == _max1 && _max1 == i + 1 && n - i - 1 == _max2) {
          for (int j = 1; j <= _max1; j++) {
            if (c[j] == 1)
              continue;
            else
              flag = 0;
          }
          if (flag) ans.push_back({i + 1, _max2});
          flag = 1;
          continue;
        }
        if (s.size() == _max2 && _max2 == i + 1 && n - i - 1 == _max1) {
          for (int j = 1; j <= _max2; j++) {
            if (c[j] == 1)
              continue;
            else
              flag = 0;
          }
          if (flag) ans.push_back({i + 1, _max1});
          flag = 1;
        }
      }
      cout << ans.size() << endl;
      for (int i = 0; i < ans.size(); i++)
        cout << ans[i].first << " " << ans[i].second << endl;
    }
  }
  return 0;
}
