#include <bits/stdc++.h>
long long powermod(long long _a, long long _b, long long _m) {
  long long _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a) % _m;
    _b /= 2;
    _a = (_a * _a) % _m;
  }
  return _r;
}
using namespace std;
template <typename T>
void pr(const T& t) {
  cout << t << "\n";
}
template <typename T, typename U, typename... ARGS>
void pr(const T& t, const U& u, const ARGS&... args) {
  cout << t << " ";
  pr(u, args...);
}
bool solve(vector<long long>& arr, long long a, long long b) {
  long long i = 0;
  vector<long long> v;
  while (a--) {
    v.push_back(arr[i]);
    i++;
  }
  sort(v.begin(), v.end());
  for (long long i = 0; i < v.size(); ++i)
    if (v[i] != i + 1) return false;
  v.clear();
  while (b--) {
    v.push_back(arr[i]);
    i++;
  }
  sort(v.begin(), v.end());
  for (long long i = 0; i < v.size(); ++i)
    if (v[i] != i + 1) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  long long tt;
  cin >> tt;
  while (tt--) {
    long long n;
    cin >> n;
    ;
    long long maxx = 0;
    vector<long long> arr(n);
    map<long long, long long> mp;
    bool flag = true;
    for (long long i = 0; i < n; ++i) {
      cin >> arr[i];
      ;
      maxx = max(maxx, arr[i]);
      mp[arr[i]]++;
    }
    bool allow = true;
    long long j = maxx;
    for (int i = 1; i <= maxx; i++) {
      if (mp[i] > 2)
        flag = false;
      else if (mp[i] == 2 && allow)
        continue;
      else if (mp[i] == 2)
        flag = false;
      else if (mp[i] == 1) {
        if (allow) j = i - 1;
        allow = false;
      } else
        flag = false;
    }
    vector<pair<long long, long long> > ans;
    if (j == 0) flag = false;
    if (flag && solve(arr, j, maxx)) {
      ans.push_back({j, maxx});
    }
    if (flag && solve(arr, maxx, j) && maxx != j) {
      ans.push_back({maxx, j});
    }
    pr(ans.size());
    for (long long i = 0; i < ans.size(); ++i) pr(ans[i].first, ans[i].second);
  }
}
