#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int a[n + 1], b[n + 1];
    long long int mx = 0;
    for (long long int i = 1; i <= n; i++) {
      cin >> a[i];
      b[i] = a[i];
      mx = max(mx, a[i]);
    }
    long long int l1 = mx, l2 = n - mx;
    sort(a + 1, a + l1 + 1);
    sort(a + l1 + 1, a + n + 1);
    sort(b + 1, b + l2 + 1);
    sort(b + l2 + 1, b + n + 1);
    set<pair<int, int> > ans;
    int f1 = 1, f2 = 1;
    for (int i = 1; i <= l1; i++) {
      if (a[i] != i) {
        f1 = 0;
      }
    }
    int c = 1;
    for (int i = l1 + 1; i <= n; i++) {
      if (a[i] != c) {
        f2 = 0;
      }
      c++;
    }
    if (f1 && f2) {
      ans.insert(make_pair(l1, l2));
    }
    f1 = 1, f2 = 1;
    for (int i = 1; i <= l2; i++) {
      if (b[i] != i) {
        f1 = 0;
      }
    }
    c = 1;
    for (int i = l2 + 1; i <= n; i++) {
      if (b[i] != c) {
        f2 = 0;
      }
      c++;
    }
    if (f1 && f2) {
      ans.insert(make_pair(l2, l1));
    }
    cout << ans.size() << '\n';
    if (ans.size()) {
      for (auto p : ans) {
        cout << p.first << " " << p.second << '\n';
      }
    }
  }
}
