#include <bits/stdc++.h>
using namespace std;
int tc;
int N, A[200005];
int lol[200005][2];
map<int, int> cnt;
bool yes;
int main() {
scanf("%d", &tc);
while(tc--) {
scanf("%d", &N);
int mx = 0;
for(int i = 1; i <= N; i++) {
scanf("%d", &A[i]);
}
for(int i = 1; i <= N; i++) {
if(!cnt.count(A[i])) {
cnt[A[i]] = 1;
mx = max(A[i], mx);
if(mx == i) lol[i][0] = 1;
}else break;
}
cnt.clear();
mx = 0;
for(int i = N; i > 0; i--) {
if(!cnt.count(A[i])) {
cnt[A[i]] = 1;
mx = max(A[i], mx);
if(mx == N - i + 1) lol[i][1] = 1;
}else break;
}
cnt.clear();
int ans = 0;
for(int i = 2; i <= N; i++) {
if(lol[i - 1][0] && lol[i][1]) {
ans++;
}
}
cout << ans << "\n";
for(int i = 2; i <= N; i++) {
if(lol[i - 1][0] && lol[i][1]) {
cout << i - 1 << " " << N - i + 1 << "\n";
}
lol[i - 1][0] = 0;
lol[i - 1][1] = 0;
lol[i][1] = 0;
}
lol[N][0] = 0;
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgdGM7CmludCBOLCBBWzIwMDAwNV07CmludCBsb2xbMjAwMDA1XVsyXTsKbWFwPGludCwgaW50PiBjbnQ7CmJvb2wgeWVzOwoKaW50IG1haW4oKSB7CglzY2FuZigiJWQiLCAmdGMpOwoJd2hpbGUodGMtLSkgewoJCXNjYW5mKCIlZCIsICZOKTsKCQlpbnQgbXggPSAwOwoJCWZvcihpbnQgaSA9IDE7IGkgPD0gTjsgaSsrKSB7CgkJCXNjYW5mKCIlZCIsICZBW2ldKTsKCQl9CgkJZm9yKGludCBpID0gMTsgaSA8PSBOOyBpKyspIHsKCQkJaWYoIWNudC5jb3VudChBW2ldKSkgewoJCQkJY250W0FbaV1dID0gMTsKCQkJCW14ID0gbWF4KEFbaV0sIG14KTsKCQkJCWlmKG14ID09IGkpIGxvbFtpXV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