#include <bits/stdc++.h>
using namespace std;
bool check(long long v[], long long start, long long end, long long total) {
  map<long long, long long> hash;
  for (long long i = 1; i <= total; i++) {
    hash.insert({i, 0});
  }
  for (long long i = start; i < end; i++) {
    hash[v[i]]++;
  }
  for (long long i = 1; i <= total; i++) {
    if (hash[i] != 1) {
      return false;
    }
  }
  return true;
}
bool get(long long v[], long long pehle, long long badme) {
  return check(v, 0, pehle, pehle) && check(v, pehle, pehle + badme, badme);
}
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long v[n];
    long long ma = INT_MIN;
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      ma = max(ma, v[i]);
    }
    set<pair<long long, long long> > ans;
    bool f1 = get(v, ma, n - ma);
    if (f1 == true) {
      ans.insert({ma, n - ma});
    }
    bool f2 = get(v, n - ma, ma);
    if (f2 == true) {
      ans.insert({n - ma, ma});
    }
    cout << ans.size() << endl;
    for (auto i = ans.begin(); i != ans.end(); i++) {
      cout << i->first << " " << i->second << endl;
    }
  }
}
