#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<pair<int, int>> pref(n + 1, {0, 0});
  vector<int> isPref(n, 0);
  pref[0].first = 1;
  pref[0].second = 1;
  int maxi = 0;
  for (int i = 0; i < n - 1; i++) {
    maxi = max(maxi, a[i]);
    if (!(pref[a[i]].first == 1)) {
      if (pref[a[i] - 1].second == 1 && pref[a[i] - 1].first == 1) {
        pref[a[i] - 1].second = 0;
        pref[a[i]].first = 1;
        pref[a[i]].second = 1;
        int ind = a[i] + 1;
        while (pref[ind].first == 1) {
          ind++;
        }
        pref[ind - 1].first = 1;
        pref[ind - 1].second = 1;
        if (ind - 1 == maxi) isPref[i] = 1;
      } else {
        pref[a[i]].first = 1;
      }
    } else
      break;
  }
  maxi = 0;
  vector<pair<int, int>> suff(n + 1, {0, 0});
  vector<int> isSuff(n, 0);
  suff[0].first = 1;
  suff[0].second = 1;
  for (int i = n - 1; i >= 1; i--) {
    maxi = max(maxi, a[i]);
    if (!(suff[a[i]].first == 1)) {
      if (suff[a[i] - 1].second == 1 && suff[a[i] - 1].first == 1) {
        suff[a[i] - 1].second = 0;
        suff[a[i]].first = 1;
        suff[a[i]].second = 1;
        int ind = a[i] + 1;
        while (suff[ind].first == 1) {
          ind++;
        }
        suff[ind - 1].first = 1;
        suff[ind - 1].second = 1;
        if (ind - 1 == maxi) isSuff[i] = 1;
      } else {
        suff[a[i]].first = 1;
      }
    } else
      break;
  }
  vector<int> ans;
  for (int i = 0; i < n - 1; i++) {
    if (isPref[i] && isSuff[i + 1]) {
      ans.push_back(i);
    }
  }
  cout << ans.size() << "\n";
  for (auto i : ans) {
    cout << i + 1 << " " << n - i - 1 << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
