#include <bits/stdc++.h>
using namespace std;
long long vis[200005], cnt[200005], arr[200005];
void solve() {
  long long i, j, k, l, m, n, x, sz = 0, flag = 1, mx = 0;
  cin >> n;
  for (i = 0; i <= n; i++) vis[i] = cnt[i] = 0;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    cnt[arr[i]]++;
    if (cnt[arr[i]] == 2) sz = max(sz, arr[i]);
    mx = max(mx, arr[i]);
    if (cnt[arr[i]] == 3) flag = 0;
  }
  vector<long long> ans;
  if (sz + mx != n) flag = 0;
  if (!flag) {
    cout << 0 << endl;
    return;
  }
  for (i = 0; i < sz; i++) {
    vis[arr[i]] = 1;
  }
  flag = 1;
  for (i = 1; i <= sz; i++) {
    if (vis[i])
      continue;
    else
      flag = 0;
  }
  if (flag) ans.push_back(sz);
  flag = 1;
  if (sz != mx) {
    for (i = 0; i <= mx; i++) vis[i] = 0;
    for (i = 0; i < mx; i++) {
      vis[arr[i]] = 1;
    }
    for (i = 1; i <= mx; i++)
      if (!vis[i]) flag = 0;
    if (flag) ans.push_back(mx);
  }
  cout << ans.size() << endl;
  for (i = 0; i < ans.size(); i++) {
    cout << ans[i] << ' ' << n - ans[i] << endl;
  }
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t;
  t = 1;
  cin >> t;
  while (t--) solve();
  return 0;
}
