#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long tt;
  cin >> tt;
  while (tt--) {
    long long n = 0, m = 0, k = 0, x = 0, y = 0, z = 0, i = 0, j = 0;
    cin >> n;
    long long a[n];
    for (i = 0; i < n; i++) cin >> a[i];
    vector<long long> v;
    y = 0;
    map<long long, long long> mp;
    for (i = 0; i < n; i++) {
      if (mp[a[i]]) break;
      mp[a[i]]++;
    }
    x = i;
    set<long long> s, s1;
    for (i = 0; i < x; i++) s.insert(a[i]);
    for (i = x; i < n; i++) s1.insert(a[i]);
    set<long long>::iterator it, it1;
    it = s.end();
    it1 = s1.end();
    it--;
    it1--;
    if (((*it) != s.size()) || ((*it1) != s1.size())) {
      s.clear();
      s1.clear();
    } else if (s.size() + s1.size() != n) {
      s.clear();
      s1.clear();
    } else {
      y++;
      v.push_back(s.size());
      v.push_back(s1.size());
    }
    mp.clear();
    s.clear();
    s1.clear();
    reverse(a, a + n);
    for (i = 0; i < n; i++) {
      if (mp[a[i]]) break;
      mp[a[i]]++;
    }
    x = i;
    for (i = 0; i < x; i++) s.insert(a[i]);
    for (i = x; i < n; i++) s1.insert(a[i]);
    it = s.end();
    it1 = s1.end();
    it--;
    it1--;
    if (((*it) != s.size()) || ((*it1) != s1.size())) {
      s.clear();
      s1.clear();
    } else if (s.size() + s1.size() != n) {
      s.clear();
      s1.clear();
    } else {
      v.push_back(n - s.size());
      v.push_back(n - s1.size());
    }
    if (v.size() == 4)
      if (v[3 - 1] == v[1 - 1] && v[2 - 1] == v[4 - 1]) {
        v.erase(v.end() - 1);
        v.erase(v.end() - 1);
      }
    cout << v.size() / 2 << '\n';
    for (i = 0; i < v.size(); i++) {
      cout << v[i] << ' ';
      if (i % 2) cout << '\n';
    }
  }
  return 0;
}
