#include <bits/stdc++.h>
using namespace std;
int t, n, m, k, x;
void genF(map<int, int> &f, map<int, int> &b, vector<int> *arr) {
  int mina = 10000000;
  int maxa = -1;
  for (int x = 1; x <= n - 1; x++) {
    if (arr[x].size() == 0) break;
    mina = min(mina, arr[x][0]);
    maxa = max(maxa, arr[x][0]);
    if (maxa - mina + 1 == x) {
      if (mina == 1) f[x]++;
    }
  }
}
void genB(map<int, int> &f, map<int, int> &b, vector<int> *arr) {
  int mina = 10000000;
  int maxa = -1;
  int p = 0;
  for (int x = 1; x <= n - 1; x++) {
    if (arr[x].size() == 0) break;
    if (arr[x].size() == 1)
      p = 0;
    else if (arr[x].size() == 2)
      p = 1;
    else
      break;
    mina = min(mina, arr[x][p]);
    maxa = max(maxa, arr[x][p]);
    if (maxa - mina + 1 == x) {
      if (maxa == n) b[x]++;
    }
  }
}
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    vector<int> arr[n];
    for (int x = 1; x <= n; x++) {
      cin >> m;
      arr[m].push_back(x);
    }
    if (arr[1].size() < 2) {
      cout << 0 << endl;
      continue;
    }
    map<int, int> forw;
    map<int, int> backw;
    genF(forw, backw, arr);
    genB(forw, backw, arr);
    int res = 0;
    vector<pair<int, int> > r;
    for (auto i = forw.begin(); i != forw.end(); i++) {
      if (backw[n - i->first]) {
        res++;
        r.push_back({i->first, n - i->first});
      }
    }
    cout << res << endl;
    for (int x = 0; x < r.size(); x++) {
      cout << r[x].first << " " << r[x].second << endl;
    }
  }
}
