#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, n, i, j, k, f, f1, arr[200001], pt[200000];
  cin >> t;
  while (t--) {
    cin >> n;
    int temp[200000] = {0};
    for (i = 0; i < n; i++) {
      cin >> arr[i];
      temp[arr[i]]++;
    }
    i = 1;
    while (temp[i] == 2) i++;
    if (temp[i] > 1)
      cout << 0 << endl;
    else {
      i--;
      j = n - i;
      for (k = 1; k <= i; k++) pt[k] = 0;
      k = 0;
      f = 0;
      while (k < i) {
        pt[arr[k]]++;
        k++;
      }
      for (k = 1; k <= i; k++) {
        if (pt[k] != 1) {
          f++;
          break;
        }
      }
      if (f == 0) {
        for (k = 1; k <= j; k++) pt[k] = 0;
        k = i;
        while (k < n) {
          pt[arr[k]]++;
          k++;
        }
        for (k = 1; k <= j; k++) {
          if (pt[k] != 1) {
            f++;
            break;
          }
        }
      }
      for (k = 1; k <= j; k++) pt[k] = 0;
      k = 0;
      f1 = 0;
      while (k < j) {
        pt[arr[k]]++;
        k++;
      }
      for (k = 1; k <= j; k++) {
        if (pt[k] != 1) {
          f1++;
          break;
        }
      }
      if (f1 == 0) {
        for (k = 1; k <= i; k++) pt[k] = 0;
        k = j;
        while (k < n) {
          pt[arr[k]]++;
          k++;
        }
        for (k = 1; k <= i; k++) {
          if (pt[k] != 1) {
            f1++;
            break;
          }
        }
      }
      if (f1 == 0 && f == 0) {
        if (i == j) {
          cout << 1 << endl;
          cout << i << " " << j << endl;
        } else {
          cout << 2 << endl;
          cout << i << " " << j << endl;
          cout << j << " " << i << endl;
        }
      } else if (f == 0) {
        cout << 1 << endl;
        cout << i << " " << j << endl;
      } else if (f1 == 0) {
        cout << 1 << endl;
        cout << j << " " << i << endl;
      } else
        cout << 0 << endl;
    }
  }
  return 0;
}
