#include <bits/stdc++.h>
using namespace std;
int arr[200010];
int an[200010], kr;
int main() {
  int t;
  cin >> t;
  while (t--) {
    kr = 0;
    int n;
    cin >> n;
    int d[200010] = {0}, a[200010] = {0};
    int ma = 0, mm = 0;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      ma = max(ma, ++d[arr[i]]);
      mm = max(mm, arr[i]);
      if (ma == 1 && mm == i + 1) {
        a[i] = 1;
      }
    }
    int dd[200010] = {0};
    ma = 0;
    mm = 0;
    for (int i = n - 1; i > 0; i--) {
      ma = max(ma, ++dd[arr[i]]);
      mm = max(mm, arr[i]);
      if (ma == 1 && n - i == mm && a[i - 1]) {
        an[kr++] = i;
      }
    }
    cout << kr << endl;
    for (int i = 0; i < kr; i++) {
      cout << an[i] << " " << n - an[i] << endl;
    }
  }
}
