#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
using ll = long long;
const bool dbg_flg = 1;
const int inf = 1e9 + 7;
const int MAXN = 2e5 + 5;
int n;
int a[MAXN];
bool check(int l1, int l2) {
  if (l1 + l2 != n) return 0;
  if (l1 <= 0 || l2 <= 0) return 0;
  vector<int> v1, v2;
  for (int i = 1; i <= l1; i++) {
    v1.push_back(a[i]);
  }
  for (int i = l1 + 1; i <= l1 + l2; i++) {
    v2.push_back(a[i]);
  }
  sort((v1).begin(), (v1).end());
  sort((v2).begin(), (v2).end());
  for (int i = 0; i < (int)(v1).size(); i++) {
    if (i + 1 != v1[i]) return 0;
  }
  for (int i = 0; i < (int)(v2).size(); i++) {
    if (i + 1 != v2[i]) return 0;
  }
  return 1;
}
void solve() {
  cin >> n;
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    mx = max(mx, a[i]);
  }
  set<pair<int, int>> res;
  if (check(mx, n - mx)) res.insert(make_pair(mx, n - mx));
  if (check(n - mx, mx)) res.insert(make_pair(n - mx, mx));
  cout << (int)(res).size() << '\n';
  for (auto i : res) {
    cout << i.first << ' ' << i.second << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  int tt = 1;
  cin >> tt;
  while (tt--) {
    solve();
  }
  return 0;
}
