#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
template <typename T>
void print(const vector<T> &x) {
  int n = x.size();
  for (int i = 0; i < (n); ++i) {
    cout << x[i];
    if (i != n - 1)
      cout << " ";
    else
      cout << endl;
  }
}
template <typename T>
void print(const vector<vector<T>> &x) {
  int n = x.size();
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (x[i].size()); ++j) {
      cout << x[i][j] << " ";
    }
    cout << endl;
  }
}
template <typename T>
void print(const vector<T> &x, int n) {
  for (int i = 0; i < (n); ++i) {
    cout << x[i];
    if (i != n - 1)
      cout << " ";
    else
      cout << endl;
  }
}
template <typename T>
void print(const vector<vector<T>> &x, int n, int m) {
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (m); ++j) {
      cout << x[i][j] << " ";
    }
    cout << endl;
  }
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
void input_init() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}
int main(int argc, char const *argv[]) {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < (n); ++i) cin >> a[i];
    vector<int> l(n, false), r(n, false);
    set<int> sl, sr;
    for (int i = 0; i < (n); ++i) {
      sl.insert(a[i]);
      if (sl.size() == i + 1 && *prev(sl.end()) == i + 1) l[i] = true;
    }
    for (int i = n - 1; i >= 0; --i) {
      sr.insert(a[i]);
      if (sr.size() == n - i && *prev(sr.end()) == n - i) r[i] = true;
    }
    vector<pair<long long, long long>> ans;
    for (int i = 0; i < (n - 1); ++i) {
      if (l[i] == true && r[i + 1] == true) {
        int l1 = i + 1;
        int l2 = n - i - 1;
        ans.emplace_back(l1, l2);
      }
    }
    cout << ans.size() << '\n';
    for (auto &&e : ans) {
      cout << e.first << ' ' << e.second << '\n';
    }
  }
  return 0;
}
