#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, res1 = 0, res2 = 0, flag = 1;
    cin >> n;
    vector<long long int> v, s;
    for (int i = 0; i < n; i++) {
      long long int t;
      cin >> t;
      v.push_back(t);
    }
    long long int temp = *max_element(v.begin(), v.end());
    s = v;
    sort(s.begin(), s.begin() + temp);
    for (int i = 0; i < temp; i++) {
      if (s[i] != i + 1) {
        flag = 0;
        break;
      }
    }
    if (flag == 1) {
      sort(s.begin() + temp, s.end());
      for (int i = 0; i < n - temp; i++) {
        if (s[i + temp] != i + 1) {
          flag = 0;
          break;
        }
      }
      if (flag == 1) res1++;
    }
    flag = 1;
    s.clear();
    s = v;
    sort(s.begin(), s.end() - temp);
    for (int i = 0; i < n - temp; i++) {
      if (s[i] != i + 1) {
        flag = 0;
        break;
      }
    }
    if (flag == 1) {
      sort(s.end() - temp, s.end());
      for (int i = 0; i < temp; i++) {
        if (s[i + n - temp] != i + 1) {
          flag = 0;
          break;
        }
      }
      if (flag == 1) res2++;
    }
    if (res1 + res2 == 0) cout << 0 << endl;
    if (res1 == 1 && res2 == 0) {
      cout << res1 + res2 << endl;
      cout << temp << " " << n - temp << endl;
    } else if (res1 == 0 && res2 == 1) {
      cout << res1 + res2 << endl;
      cout << n - temp << " " << temp << endl;
    }
    if (res1 == 1 && res2 == 1) {
      if (n - temp == temp) {
        cout << res1 + res2 - 1 << endl;
        cout << temp << " " << temp << endl;
      } else {
        cout << res1 + res2 << endl;
        cout << n - temp << " " << temp << endl;
        cout << temp << " " << n - temp << endl;
      }
    }
  }
  return 0;
}
