#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.second < b.second);
}
long long int modpower(long long int a, long long int b, long long int c) {
  long long int res = 1;
  while (b) {
    if (b & 1LL) res = (res * a) % c;
    a = (a * a) % c;
    b >>= 1;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << fixed << setprecision(12);
  int miami;
  miami = 1;
  cin >> miami;
  while (miami--) {
    int n, x, y, z;
    cin >> n;
    int a[n];
    for (long long int i = 0; i < n; i++) {
      cin >> a[i];
    };
    int m = 1;
    for (long long int i = 0; i < n; i++) {
      if (a[i] > m) m = a[i];
    }
    x = m;
    y = n - m;
    if (x > 0 && y > 0 && y <= x) {
      int flag1 = 0, flag2 = 0;
      set<int> s1, s2;
      for (long long int i = 0; i < x; i++) s1.insert(a[i]);
      for (long long int i = x; i < n; i++) s2.insert(a[i]);
      if (s1.size() + s2.size() == n) {
        auto it1 = s1.end();
        --it1;
        auto it2 = s2.end();
        --it2;
        if (s1.size() == x && *it1 == x && s2.size() == y && *it2 == y)
          flag1 = 1;
      }
      x = n - m;
      y = m;
      s1.clear();
      s2.clear();
      for (long long int i = 0; i < x; i++) s1.insert(a[i]);
      for (long long int i = x; i < n; i++) s2.insert(a[i]);
      if (s1.size() + s2.size() == n) {
        auto it1 = s1.end();
        --it1;
        auto it2 = s2.end();
        --it2;
        if (s1.size() == x && *it1 == x && s2.size() == y && *it2 == y)
          flag2 = 1;
      }
      if (x == y) {
        cout << (flag1 + flag2) / 2 << '\n';
        if (flag1 > 0) cout << x << " " << y << '\n';
        continue;
      }
      cout << flag1 + flag2 << '\n';
      if (flag1 > 0) cout << m << " " << n - m << '\n';
      if (flag2 > 0) cout << n - m << " " << m << '\n';
    } else
      cout << 0 << '\n';
  }
  return 0;
}
