#include <bits/stdc++.h>
using namespace std;
const long long max_n = 2e5 + 5;
long long t, n, k;
long long a[max_n];
bool v[max_n + 1] = {false};
long long l[max_n] = {0}, r[max_n] = {0};
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> a[i];
    k = 1;
    for (int i = 0; i < n; ++i) {
      v[a[i]] = true;
      while (v[k]) ++k;
      l[i] = k - 1;
    }
    for (int i = 1; i <= n; ++i) v[i] = false;
    k = 1;
    for (int i = n - 1; i >= 0; --i) {
      v[a[i]] = true;
      while (v[k]) ++k;
      r[i] = k - 1;
    }
    vector<long long> l1;
    l1.clear();
    for (int i = 0; i < n - 1; ++i) {
      if (l[i] == (i + 1) and r[i + 1] == (n - i - 1)) l1.push_back(i + 1);
    }
    cout << l1.size() << endl;
    for (int i = 0; i < l1.size(); ++i)
      cout << l1[i] << " " << (n - l1[i]) << endl;
    for (int i = 0; i < n; ++i) {
      l[i] = 0;
      r[i] = 0;
      v[i + 1] = false;
    }
  }
  return 0;
}
