#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  long long int n;
  while (t--) {
    cin >> n;
    long long int a[n];
    for (long long int i = 0; i < n; i++) cin >> a[i];
    long long int k = 0;
    vector<pair<long long int, long long int>> ans;
    long long int maxf[n - 1];
    long long int maxb[n - 1];
    long long int rep1[n];
    long long int rep2[n];
    for (long long int i = 0; i < n; i++) rep1[i] = rep2[i] = 0;
    long long int x1 = -1;
    long long int x2 = -1;
    long long int max1 = -1;
    long long int truth1[n - 1];
    long long int truth2[n - 1];
    for (long long int i = 0; i < n - 1; i++) truth1[i] = truth2[i] = 1;
    for (long long int i = 0; i < n - 1; i++) {
      if (a[i] > max1) max1 = a[i];
      long long int x = a[i];
      maxf[i] = max1;
      if (rep1[x] == 0)
        rep1[x] = 1;
      else
        x1 = 1;
      if (x1 == 1) truth1[i] = -1;
    }
    max1 = -1;
    for (long long int i = n - 1; i > 0; i--) {
      if (a[i] > max1) max1 = a[i];
      maxb[i - 1] = max1;
      long long int x = a[i];
      if (rep2[x] == 0)
        rep2[x] = 1;
      else
        x2 = 1;
      if (x2 == 1) truth2[i - 1] = -1;
    }
    for (long long int i = 0; i < n - 1; i++) {
      if ((maxf[i] == i + 1) && (truth1[i] == 1) && (maxb[i] == n - 1 - i) &&
          (truth2[i] == 1)) {
        k++;
        ans.push_back(make_pair(i + 1, n - 1 - i));
      }
    }
    cout << k << "\n";
    for (auto i = 0; i < k; i++) {
      cout << (ans[i].first) << " " << (ans[i].second) << "\n";
    }
  }
  return 0;
}
