#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, p[212345], visto[212345], mex1[212345], mex2[212345];
  vector<pair<int, int>> resp;
  scanf("%d", &t);
  while (t--) {
    resp.clear();
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) visto[i] = 0;
    int next1 = 1, next2 = 1;
    for (int i = 1; i <= n; ++i) {
      scanf("%d", &p[i]);
      if (next1 == p[i]) {
        next1++;
        for (int j = p[i] + 1; j <= n; ++j) {
          if (visto[j])
            next1++;
          else
            break;
        }
      }
      visto[p[i]] = 1;
      mex1[i] = next1;
    }
    for (int i = 1; i <= n; ++i) visto[i] = 0;
    for (int i = n; i >= 1; --i) {
      if (next2 == p[i]) {
        next2++;
        for (int j = p[i] + 1; j <= n; ++j) {
          if (visto[j])
            next2++;
          else
            break;
        }
      }
      visto[p[i]] = 1;
      mex2[i] = next2;
    }
    for (int i = 1; i <= (n - 1); ++i) {
      if (mex1[i] == i + 1 && mex2[i + 1] == n - i + 1) {
        resp.push_back({i, n - i});
      }
    }
    printf("%d\n", resp.size());
    for (int i = 0; i < resp.size(); ++i)
      printf("%d %d\n", resp[i].first, resp[i].second);
  }
  return 0;
}
