#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, i, j;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long arr[n + 1];
    long long tot = 0;
    for (i = 1; i <= n; i++) {
      cin >> arr[i];
      tot += arr[i];
    }
    map<long long, long long> cnt1, cnt2;
    long long chkr1[n + 1], chkr2[n + 2];
    memset(chkr1, 0, sizeof(chkr1));
    memset(chkr2, 0, sizeof(chkr2));
    for (i = 1; i <= n; i++) {
      chkr1[i] = chkr1[i - 1];
      if (cnt1[arr[i]] == 0) {
        chkr1[i]++;
      }
      cnt1[arr[i]]++;
    }
    for (i = n; i >= 1; i--) {
      chkr2[i] = chkr2[i + 1];
      if (cnt2[arr[i]] == 0) {
        chkr2[i]++;
      }
      cnt2[arr[i]]++;
    }
    long long adder = 0;
    vector<long long> res;
    for (i = 1; i < n; i++) {
      adder += arr[i];
      bool val1 = (adder == (i * (i + 1) / 2));
      long long k = n - i;
      bool val2 = ((tot - adder) == (k * (k + 1) / 2));
      bool val3 = (chkr1[i] == i);
      bool val4 = (chkr2[i + 1] == (n - i));
      if (val1 && val2 && val3 && val4) res.push_back(i);
    }
    long long len = res.size();
    cout << len << "\n";
    for (i = 0; i < len; i++) cout << res[i] << " " << n - res[i] << "\n";
  }
  return 0;
}
