#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
long long n, m, i, j, a[N], lemax, rimax;
set<long long> le, ri;
vector<pair<long long, long long> > ans;
bool leval[N], rival[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    ans.clear();
    le.clear();
    ri.clear();
    lemax = 0, rimax = 0;
    cin >> n;
    for (i = 0; i < n; i++) {
      leval[i] = false;
      rival[i] = false;
      cin >> a[i];
    }
    for (i = 0; i < n; i++) {
      if (le.count(a[i]) == 0) {
        lemax = max(lemax, a[i]);
        le.insert(a[i]);
      } else
        break;
      if (lemax == le.size()) leval[i] = true;
    }
    for (i = n - 1; i >= 0; i--) {
      if (ri.count(a[i]) == 0) {
        rimax = max(rimax, a[i]);
        ri.insert(a[i]);
      } else
        break;
      if (rimax == ri.size()) rival[i] = true;
    }
    for (i = 0; i < n - 1; i++) {
      if (leval[i] && rival[i + 1]) ans.push_back(make_pair(i + 1, n - i - 1));
    }
    cout << ans.size() << endl;
    for (i = 0; i < ans.size(); i++) {
      cout << ans[i].first << " " << ans[i].second << endl;
    }
  }
}
