#include <bits/stdc++.h>
using namespace std;
void check(vector<int>& v, vector<bool>& ans) {
  int n = v.size();
  vector<bool> found(n + 1);
  int curV = 1;
  int maxV = 0;
  for (int i = 0; i < n; i++) {
    if (found[v[i]]) {
      break;
    }
    found[v[i]] = true;
    maxV = max(maxV, v[i]);
    for (; found[curV]; curV++) {
    }
    if (curV > maxV) {
      ans[i] = true;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  for (int ii = 0; ii < t; ii++) {
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++) {
      cin >> v[i];
    }
    vector<bool> bstart(n);
    vector<bool> bend(n);
    check(v, bstart);
    reverse(v.begin(), v.end());
    check(v, bend);
    reverse(bend.begin(), bend.end());
    vector<pair<int, int>> ans;
    for (int i = 0; i < n - 1; i++) {
      if (bstart[i] && bend[i + 1]) {
        ans.push_back({i + 1, n - i - 1});
      }
    }
    cout << ans.size() << "\n";
    for (int i = 0; i < ans.size(); i++) {
      cout << ans[i].first << " " << ans[i].second << "\n";
    }
  }
  return 0;
}
