#include <bits/stdc++.h>
using namespace std;
int main() {
  int numberOfCases;
  cin >> numberOfCases;
  for (int i = 0; i < numberOfCases; ++i) {
    int len;
    cin >> len;
    vector<int> mem(len, 0);
    for (int i = 0; i < len; ++i) {
      cin >> mem[i];
    }
    int maxNumber;
    maxNumber = *max_element(mem.begin(), mem.end());
    vector<int> count(len, 0);
    for (auto& itermem : mem) {
      count[itermem]++;
    }
    int state = 0;
    int startNumberOfOne = -1;
    bool isFailedSecondStep = false;
    for (int number = 1; number < len; ++number) {
      if (state == 0) {
        if (count[number] == 2) {
          continue;
        } else if (count[number] == 1) {
          startNumberOfOne = number;
          state = 1;
        } else {
          if (count[number] == 0 && (len % 2 == 0) && (number - 1) == len / 2) {
            startNumberOfOne = number;
            break;
          } else {
            isFailedSecondStep = true;
            break;
          }
        }
      } else {
        if (count[number] == 1) {
          continue;
        } else {
          if (number != (maxNumber + 1)) {
            isFailedSecondStep = true;
            break;
          } else {
            break;
          }
        }
      }
    }
    if (isFailedSecondStep) {
      cout << 0 << endl;
      continue;
    }
    if (len == 2 && mem[0] == 1 && mem[1] == 1) {
      startNumberOfOne = 2;
    }
    vector<bool> searchedFullStep(maxNumber + 1, false);
    vector<bool> searchedSmallStep(startNumberOfOne, false);
    bool isSearchingFull = true;
    bool isSearchingSmall = true;
    int isSearchingFullCount = 0;
    int isSearchingSmallCount = 0;
    int retSearchingFull = -1;
    int retSearchingSmall = -1;
    for (int index = 0; index < (int)mem.size(); ++index) {
      int preVal = mem[index];
      if (isSearchingFull) {
        if (preVal <= maxNumber && !searchedFullStep[preVal]) {
          searchedFullStep[preVal] = true;
          isSearchingFullCount++;
          if (isSearchingFullCount == maxNumber) {
            retSearchingFull = index;
            isSearchingFull = false;
          }
        } else {
          isSearchingFull = false;
        }
      }
      if (isSearchingSmall) {
        if (preVal < startNumberOfOne && !searchedSmallStep[preVal]) {
          searchedSmallStep[preVal] = true;
          isSearchingSmallCount++;
          if (isSearchingSmallCount == (startNumberOfOne - 1)) {
            retSearchingSmall = index;
            isSearchingSmall = false;
          }
        } else {
          isSearchingSmall = false;
        }
      }
    }
    int retCount = 0;
    if (retSearchingFull != -1) retCount++;
    if (retSearchingSmall != -1) retCount++;
    if (retSearchingFull == retSearchingSmall && retSearchingFull != -1) {
      retCount--;
      retSearchingSmall = -1;
    }
    cout << retCount << endl;
    if (retSearchingFull != -1) {
      cout << retSearchingFull + 1 << " " << len - (retSearchingFull + 1)
           << endl;
    }
    if (retSearchingSmall != -1) {
      cout << retSearchingSmall + 1 << " " << len - (retSearchingSmall + 1)
           << endl;
    }
  }
  return 0;
}
