#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, t, n, m, x, p, k;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> t;
  while (t--) {
    cin >> n;
    int ways = 0;
    vector<int> ans;
    vector<int> v(n);
    for (long long i = 0; i < n; i++) cin >> v[i];
    bool repeat = 0;
    set<int> elems;
    set<int> other(v.begin(), v.end());
    map<int, int> counts;
    for (long long i = 0; i < n; i++) {
      counts[v[i]]++;
    }
    int smal = 1e8;
    int lar = -1e8;
    for (int i = 0; i < n - 1; i++) {
      if (elems.find(v[i]) == elems.end()) {
        elems.insert(v[i]);
        counts[v[i]]--;
        if (counts[v[i]] == 0) other.erase(v[i]);
        if (v[i] < smal) smal = v[i];
        if (v[i] > lar) lar = v[i];
        if (lar - smal + 1 == elems.size() && smal == 1 && lar == elems.size())
          if ((n - i - 1 == other.size() && *other.begin() == 1 &&
               *other.rbegin() == other.size()))
            ans.push_back(i + 1);
      } else {
        repeat = 0;
        break;
      }
    }
    cout << ans.size() << '\n';
    for (int x : ans) cout << x << ' ' << n - x << '\n';
  }
  return 0;
}
