#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[n];
    int max_val = -1;
    for (int i = 0; i < n; i++) {
      cin >> arr[i];
      max_val = max(max_val, arr[i]);
    }
    int l1 = max_val;
    int l2 = n - max_val;
    bool case1 = true;
    multiset<int> a, b;
    for (int i = 0; i < l1; i++) {
      a.insert(arr[i]);
    }
    for (int i = l1; i < n; i++) {
      b.insert(arr[i]);
    }
    for (int i = 1; i <= l1; i++) {
      if (a.count(i) != 1) {
        case1 = false;
        break;
      }
    }
    for (int i = 1; i <= l2; i++) {
      if (b.count(i) != 1) {
        case1 = false;
        break;
      }
    }
    bool case2 = true;
    multiset<int> c, d;
    for (int i = 0; i < l2; i++) {
      c.insert(arr[i]);
    }
    for (int i = l2; i < n; i++) {
      d.insert(arr[i]);
    }
    for (int i = 1; i <= l2; i++) {
      if (c.count(i) != 1) {
        case2 = false;
        break;
      }
    }
    for (int i = 1; i <= l1; i++) {
      if (d.count(i) != 1) {
        case2 = false;
        break;
      }
    }
    if (case1 && case2) {
      if (l1 == n - l1) {
        cout << 1 << '\n';
        cout << l1 << " " << l1 << "\n";
      } else {
        cout << 2 << "\n";
        cout << l1 << " " << n - l1 << "\n";
        cout << n - l1 << " " << l1 << '\n';
      }
    } else if (case1) {
      cout << 1 << "\n";
      cout << l1 << " " << n - l1 << "\n";
    } else if (case2) {
      cout << 1 << "\n";
      cout << n - l1 << " " << l1 << "\n";
    } else {
      cout << 0 << "\n";
    }
  }
  return 0;
}
