#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
template <typename T>
void chmin(T &x, const T &y) {
  if (x > y) x = y;
}
template <typename T>
void chmax(T &x, const T &y) {
  if (x < y) x = y;
}
template <typename T>
T gcd(T x, T y) {
  return y ? gcd(y, x % y) : x;
}
const int N = 2e5 + 5;
int n, a[N], mx;
int l[N], r[N];
set<int> s;
vector<pair<int, int> > p;
void solve(int times) {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  mx = 0;
  s.clear();
  for (int i = 1; i <= n; ++i) {
    chmax(mx, a[i]);
    s.insert(a[i]);
    if (mx == i && s.size() == i) {
      l[i] = true;
    } else
      l[i] = false;
  }
  mx = 0;
  s.clear();
  for (int i = n; i >= 1; --i) {
    chmax(mx, a[i]);
    s.insert(a[i]);
    if (mx == n - i + 1 && s.size() == n - i + 1) {
      r[i] = true;
    } else
      r[i] = false;
  }
  p.clear();
  for (int i = 1; i < n; ++i) {
    if (l[i] && r[i + 1]) p.push_back(make_pair(i, n - i));
  }
  cout << p.size() << endl;
  for (int i = 0; i < p.size(); ++i) {
    cout << p[i].first << ' ' << p[i].second << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int times = 1;
  int T;
  cin >> T;
  for (; T--;) {
    solve(times++);
  }
  return 0;
}
