#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n, p, q, ans, x, y;
  cin >> t;
  while (t--) {
    x = 0;
    y = 0;
    ans = 0;
    p = 0;
    cin >> n;
    long long int a[n];
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (p < a[i]) p = a[i];
    }
    int b[p + 1];
    if (p < n)
      q = n - p;
    else
      goto here2;
    for (int i = 0; i <= p; i++) b[i] = 0;
    for (int i = 0; i < p; i++) {
      b[a[i]]++;
    }
    for (int i = 1; i <= p; i++) {
      if (b[i] != 1) {
        goto here1;
      }
    }
    for (int i = 0; i <= q; i++) b[i] = 0;
    for (int i = p; i < n; i++) b[a[i]]++;
    for (int i = 1; i <= q; i++) {
      if (b[i] != 1) {
        goto here1;
      }
    }
    ans++;
    x = 1;
  here1:
    for (int i = 0; i <= q; i++) b[i] = 0;
    for (int i = 0; i < q; i++) {
      b[a[i]]++;
    }
    for (int i = 1; i <= q; i++) {
      if (b[i] != 1) {
        goto here2;
      }
    }
    for (int i = 0; i <= p; i++) b[i] = 0;
    for (int i = q; i < n; i++) b[a[i]]++;
    for (int i = 1; i <= p; i++) {
      if (b[i] != 1) {
        goto here2;
      }
    }
    y = 1;
    ans++;
  here2:
    if (ans == 0)
      cout << ans << endl;
    else if (ans == 1) {
      if (x == 1)
        cout << ans << endl << p << " " << q << endl;
      else
        cout << ans << endl << q << " " << p << endl;
    } else {
      if (p == q)
        cout << "1\n" << p << " " << q << endl;
      else {
        cout << ans << endl;
        cout << p << " " << q << endl;
        cout << q << " " << p << endl;
      }
    }
  }
}
