#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
template <typename T>
void setmax(T& x, T y) {
  x = max(x, y);
}
template <typename T>
void setmin(T& x, T y) {
  x = min(x, y);
}
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    vector<long long> pref(n);
    vector<long long> pref_mx(n);
    vector<long long> pref_cnt(n);
    vector<long long> suf(n);
    vector<long long> suf_mx(n);
    vector<long long> suf_cnt(n);
    for (int i = 0; i < int(n); i++) cin >> a[i];
    set<long long> cnt;
    for (int i = 0; i < int(n); i++) {
      if (i)
        pref[i] = pref[i - 1] + a[i];
      else
        pref[i] = a[i];
      if (i)
        pref_mx[i] = max(pref_mx[i - 1], a[i]);
      else
        pref_mx[i] = a[i];
      cnt.insert(a[i]);
      pref_cnt[i] = (int)cnt.size();
    }
    reverse(a.begin(), a.end());
    set<long long> cnt1;
    for (int i = 0; i < int(n); i++) {
      if (i)
        suf[i] = suf[i - 1] + a[i];
      else
        suf[i] = a[i];
      if (i)
        suf_mx[i] = max(suf_mx[i - 1], a[i]);
      else
        suf_mx[i] = a[i];
      cnt1.insert(a[i]);
      suf_cnt[i] = (int)cnt1.size();
    }
    reverse(suf.begin(), suf.end());
    reverse(suf_mx.begin(), suf_mx.end());
    reverse(suf_cnt.begin(), suf_cnt.end());
    vector<pair<int, int>> ans;
    for (int i = 0; i < int(n - 1); i++) {
      long long l1 = i + 1;
      long long l2 = n - l1;
      if (pref[i] == (l1 * (l1 + 1) / 2) and pref_mx[i] == l1 and
          pref_cnt[i] == l1 and suf[i + 1] == (l2 * (l2 + 1) / 2) and
          suf_mx[i + 1] == l2 and suf_cnt[i + 1] == l2) {
        ans.push_back({l1, l2});
      }
    }
    cout << (int)ans.size() << '\n';
    if ((int)ans.size()) {
      for (auto pp : ans) {
        cout << pp.first << ' ' << pp.second << '\n';
      }
    }
  }
}
