#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
ostream &operator<<(ostream &os, pair<T1, T2> &p);
template <class T>
ostream &operator<<(ostream &os, vector<T> &v);
template <class T>
ostream &operator<<(ostream &os, set<T> &v);
const long long mod = 1e9 + 7;
const int N = 2e5 + 5;
void Solve(int cas) {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<pair<int, int> > ans;
  map<int, int> mp;
  bool flg = true;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
    if (mp[a[i]] > 2) {
      flg = false;
    }
  }
  if (!flg) {
    cout << 0 << "\n";
    return;
  }
  mp.clear();
  vector<bool> pref(n, 0), suf(n, 0);
  int mex = 1;
  for (int i = 0; i < n; i++) {
    mp[a[i]]++;
    if (mp[a[i]] == 2) break;
    if (a[i] == mex) {
      while (mp[mex] == 1) {
        mex++;
      }
    }
    if (i + 1 == mex - 1) pref[i] = 1;
  }
  mp.clear();
  mex = 1;
  for (int i = n - 1, j = 0; i >= 0; i--, j++) {
    mp[a[i]]++;
    if (mp[a[i]] == 2) break;
    if (a[i] == mex) {
      while (mp[mex] == 1) {
        mex++;
      }
    }
    if (j + 1 == mex - 1) suf[i] = 1;
  }
  for (int i = 0; i < n - 1; i++) {
    int l = i, r = i + 1;
    if (pref[l] && suf[r]) {
      ans.push_back({i + 1, n - i - 1});
    }
  }
  cout << ans.size() << endl;
  for (auto it : ans) {
    cout << it.first << " " << it.second << endl;
  }
}
int main() {
  int t = 1, cas = 0;
  scanf("%d", &t);
  while (t--) {
    Solve(++cas);
  }
  return 0;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, pair<T1, T2> &p) {
  os << "{" << p.first << ", " << p.second << "} ";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "[ ";
  for (int i = 0; i < v.size(); i++) {
    os << v[i] << " ";
  }
  os << " ]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, set<T> &v) {
  os << "[ ";
  for (T i : v) {
    os << i << " ";
  }
  os << " ]";
  return os;
}
