import java.io.*;
import java.util.*;
public class Main {
    static class Scan {
        private byte[] buf=new byte[1024];
        private int index;
        private InputStream in;
        private int total;
        public Scan()
        {
            in=System.in;
        }
        public int scan()throws IOException
        {
            if(total<0)
            throw new InputMismatchException();
            if(index>=total)
            {
                index=0;
                total=in.read(buf);
                if(total<=0)
                return -1;
            }
            return buf[index++];
        }
        public int scanInt()throws IOException
        {
            int integer=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    integer*=10;
                    integer+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            return neg*integer;
        }
        public double scanDouble()throws IOException
        {
            double doub=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n)&&n!='.')
            {
                if(n>='0'&&n<='9')
                {
                    doub*=10;
                    doub+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            if(n=='.')
            {
                n=scan();
                double temp=1;
                while(!isWhiteSpace(n))
                {
                    if(n>='0'&&n<='9')
                    {
                        temp/=10;
                        doub+=(n-'0')*temp;
                        n=scan();
                    }
                    else throw new InputMismatchException();
                }
            }
            return doub*neg;
        }
        public String scanString()throws IOException
        {
            StringBuilder sb=new StringBuilder();
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            while(!isWhiteSpace(n))
            {
                sb.append((char)n);
                n=scan();
            }
            return sb.toString();
        }
        private boolean isWhiteSpace(int n)
        {
            if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
            return true;
            return false;
        }
    }

    public static void main(String args[]) throws IOException {
        Scan input=new Scan();
        int test=input.scanInt();
        for(int t=1;t<=test;t++) {
            int n=input.scanInt();
            int arr[]=new int[n];
            int arr1[]=new int[n];
            int arr2[]=new int[n];
            for(int i=0;i<n;i++) {
                arr[i]=input.scanInt();
                arr1[i]=arr[i];
                arr2[i]=arr[i];
            }
            Set<Integer> hash_set=new HashSet<>();
            int indx=-1;
            int count=0;
            StringBuilder ans=new StringBuilder("");
            for(int i=0;i<n;i++){
                if(hash_set.contains(arr[i])) {
                    indx=i;
                    break;
                }
                hash_set.add(arr[i]);
            }
            if(indx!=-1 && check(arr1,indx)) {
                count++;
                ans.append(indx+" "+(arr.length-indx)+"\n");
            }
            int indx2=-1;
            hash_set=new HashSet<>();
            for(int i=arr.length-1;i>=0;i--){
                if(hash_set.contains(arr[i])) {
                    indx2=i;
                    break;
                }
                hash_set.add(arr[i]);
            }
            if(indx2!=-1 && (indx2+1)!=indx && check(arr2,indx2+1)) {
                count++;
                ans.append((indx2+1)+" "+(arr.length-indx2-1));
            }
            System.out.println(count+"\n"+ans);
        }
    }
    public static boolean check(int arr[],int indx) {
        Arrays.sort(arr,0,indx);
        Arrays.sort(arr,indx,arr.length);
        for(int i=0,j=1;i<indx;i++,j++) {
            if(arr[i]!=j) {
                return false;
            }
        }
        for(int i=indx,j=1;i<arr.length;i++,j++) {
            if(arr[i]!=j) {
                return false;
            }
        }
        return true;
    }
}


import java.util.*;
public class dreamoon3 {
    private static boolean isPerm(List<Integer> a) {
        TreeSet<Integer> tree = new TreeSet<>(a);
        // tree.forEach((k) -> { System.out.print(k+" "); });
        // System.out.println();
        return tree.size() == a.size() && tree.last() == a.size();
    }
    public static void main(String[] args) {
        Scanner iangay = new Scanner(System.in);
        int tc = iangay.nextInt();
        for (int i = 0; i < tc; i++) {
            int listLength = iangay.nextInt();
            ArrayList<Integer> totalList = new ArrayList<>();
            for (int j = 0; j < listLength; j++) { totalList.add(iangay.nextInt()); }
            HashMap<Integer, Integer> lvalues = new HashMap<>();
            for (int j = 1; j < listLength; j++) { if (isPerm(totalList.subList(0, j)) && isPerm(totalList.subList(j, listLength))) { lvalues.put(j, listLength-j); } }
            System.out.println(lvalues.size());
            lvalues.forEach((k, v) -> { System.out.println(k+" "+v); });
        }
    }
}


import java.util.*;
public class dreamoon3 {
    private static boolean isPerm(List<Integer> a) {
        TreeSet<Integer> tree = new TreeSet<>(a);
        return tree.size() == a.size() && tree.last() == a.size();
    }
    public static void main(String[] args) {
        Scanner iangay = new Scanner(System.in);
        int tc = iangay.nextInt();
        for (int i = 0; i < tc; i++) {
            int listLength = iangay.nextInt();
            ArrayList<Integer> totalList = new ArrayList<>();
            for (int j = 0; j < listLength; j++) { totalList.add(iangay.nextInt()); }
            TreeSet<Integer> tree = new TreeSet<>(totalList);
            HashMap<Integer, Integer> lvalues = new HashMap<>();
            int biggest = tree.last(); int pivot = totalList.indexOf(biggest);
            if (isPerm(totalList.subList(0, biggest)) && isPerm(totalList.subList(biggest, listLength))) { lvalues.put(biggest, listLength-biggest); }
            if (isPerm(totalList.subList(0, listLength-biggest)) && isPerm(totalList.subList(listLength-biggest, listLength))) { lvalues.put(listLength-biggest, biggest); }
            System.out.println(lvalues.size());
            lvalues.forEach((k, v) -> { System.out.println(k+" "+v); });
        }
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.InputMismatchException;

public class B {
	private static int n;
	private static int[] a;

	public static void main(String[] args) {
		int t = in.nextInt();
		while (t-- > 0) {
			n = ini();
			a = ina(n);
			long sum = 0;
			for(int x: a) sum+=x;
			long sum2 = 0;
			int poss = 0;
			StringBuilder sb = new StringBuilder();
			for(int i=0; i<n; i++) {
				sum2 += a[i];
				if (sum2==(i+1)*1L*(i+2)/2 && sum-sum2==(n-i-1)*1L*(n-i)/2) {
					sb.append((i+1)+" "+(n-i-1)+"\n");
					poss++;
				}
			}

			println(poss);
			if (poss!=0)
			println(sb.toString().trim());
		}

		out.flush();
		out.close();

	}

	//NONPROBLEM CODE

	private static InputReader in = new InputReader(System.in);
	private static PrintWriter out = new PrintWriter(System.out);

	private static class InputReader {

		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;

		public InputReader(InputStream st) {
			this.stream = st;
		}

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

	}

	//INPUT SHORTCUTS

	private static int[] ina(int n) {
		int[] temp = new int[n];
		for (int i = 0; i < n; i++) {
			temp[i] = in.nextInt();
		}
		return temp;
	}

	private static int ini() {
		return in.nextInt();
	}

	//OTHER SHORTCUTS
	public static void sort(int[] a) {
		Arrays.sort(a);
	}

	//PRINT SHORTCUTS

	private static void println(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static void print(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.flush();
	}

	private static void debug(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static HashMap<Integer, ArrayList<Integer>> intree(int n) {

		HashMap<Integer, ArrayList<Integer>> g = new HashMap<>();
		for (int i = 0; i < n; i++) {
			g.put(i, new ArrayList<>());
		}

		for (int i = 0; i < n - 1; i++) {
			int u = ini() - 1;
			int v = ini() - 1;
			g.get(u).add(v);
			g.get(v).add(u);
		}

		return g;
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;

public class B {
	private static int n;
	private static int[] a;

	public static void main(String[] args) {
		int t = in.nextInt();
		while (t-- > 0) {
			n = ini();
			a = ina(n);
			long sum = 0;
			for(int x: a) sum+=x;
			long sum2 = 0;
			int poss = 0;
			StringBuilder sb = new StringBuilder();
			HashSet<Integer> set = new HashSet<>();
			HashSet<Integer> set2 = new HashSet<>();
			for(int i=0; i<n; i++) {
				sum2 += a[i];
				set.add(a[i]);
				if (sum2!=sum && set.size()==i+1 && sum2==(i+1)*1L*(i+2)/2 && sum-sum2==(n-i-1)*1L*(n-i)/2) {
					sb.append((i+1)+" "+(n-i-1)+"\n");
					poss++;
				}
			}

			println(poss);
			if (poss!=0)
				println(sb.toString().trim());
		}

		out.flush();
		out.close();

	}

	//NONPROBLEM CODE

	private static InputReader in = new InputReader(System.in);
	private static PrintWriter out = new PrintWriter(System.out);

	private static class InputReader {

		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;

		public InputReader(InputStream st) {
			this.stream = st;
		}

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

	}

	//INPUT SHORTCUTS

	private static int[] ina(int n) {
		int[] temp = new int[n];
		for (int i = 0; i < n; i++) {
			temp[i] = in.nextInt();
		}
		return temp;
	}

	private static int ini() {
		return in.nextInt();
	}

	//OTHER SHORTCUTS
	public static void sort(int[] a) {
		Arrays.sort(a);
	}

	//PRINT SHORTCUTS

	private static void println(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static void print(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.flush();
	}

	private static void debug(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static HashMap<Integer, ArrayList<Integer>> intree(int n) {

		HashMap<Integer, ArrayList<Integer>> g = new HashMap<>();
		for (int i = 0; i < n; i++) {
			g.put(i, new ArrayList<>());
		}

		for (int i = 0; i < n - 1; i++) {
			int u = ini() - 1;
			int v = ini() - 1;
			g.get(u).add(v);
			g.get(v).add(u);
		}

		return g;
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;

public class B {
	private static int n;
	private static int[] a;

	public static void main(String[] args) {
		int t = in.nextInt();
		while (t-- > 0) {
			n = ini();
			a = ina(n);
			long sum = 0;
			for(int x: a) sum+=x;
			long sum2 = 0;
			int poss = 0;
			StringBuilder sb = new StringBuilder();

			for(int i=0; i<n; i++) {
				sum2 += a[i];
				if (sum2!=sum && sum2==(i+1)*1L*(i+2)/2 && sum-sum2==(n-i-1)*1L*(n-i)/2) {
					sb.append((i+1)+" "+(n-i-1)+"\n");
					poss++;
				}
			}

			println(poss);
			if (poss!=0)
				println(sb.toString().trim());
		}

		out.flush();
		out.close();

	}

	//NONPROBLEM CODE

	private static InputReader in = new InputReader(System.in);
	private static PrintWriter out = new PrintWriter(System.out);

	private static class InputReader {

		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;

		public InputReader(InputStream st) {
			this.stream = st;
		}

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

	}

	//INPUT SHORTCUTS

	private static int[] ina(int n) {
		int[] temp = new int[n];
		for (int i = 0; i < n; i++) {
			temp[i] = in.nextInt();
		}
		return temp;
	}

	private static int ini() {
		return in.nextInt();
	}

	//OTHER SHORTCUTS
	public static void sort(int[] a) {
		Arrays.sort(a);
	}

	//PRINT SHORTCUTS

	private static void println(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static void print(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.flush();
	}

	private static void debug(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static HashMap<Integer, ArrayList<Integer>> intree(int n) {

		HashMap<Integer, ArrayList<Integer>> g = new HashMap<>();
		for (int i = 0; i < n; i++) {
			g.put(i, new ArrayList<>());
		}

		for (int i = 0; i < n - 1; i++) {
			int u = ini() - 1;
			int v = ini() - 1;
			g.get(u).add(v);
			g.get(v).add(u);
		}

		return g;
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;

public class B {
	private static int n;
	private static int[] a;

	public static void main(String[] args) {
		int t = in.nextInt();
		while (t-- > 0) {
			n = ini();
			a = ina(n);
			long sum = 0;
			for(int x: a) sum+=x;
			long sum2 = 0;
			int poss = 0;
			StringBuilder sb = new StringBuilder();
			HashSet<Integer> set = new HashSet<>();
			HashSet<Integer> set2 = new HashSet<>();

			int[] size = new int[n];
			for(int i=n-1; i>=0; i--) {
				set2.add(a[i]);
				size[i] = set2.size();
			}

			for(int i=0; i<n; i++) {
				sum2 += a[i];
				set.add(a[i]);
				if (sum2!=sum && set.size()==i+1 && sum2==(i+1)*1L*(i+2)/2 && sum-sum2==(n-i-1)*1L*(n-i)/2 && (i+1<n && size[i+1]==n-i-1?true:false)) {
					sb.append((i+1)+" "+(n-i-1)+"\n");
					poss++;
				}
			}

			println(poss);
			if (poss!=0)
				println(sb.toString().trim());
		}

		out.flush();
		out.close();

	}

	//NONPROBLEM CODE

	private static InputReader in = new InputReader(System.in);
	private static PrintWriter out = new PrintWriter(System.out);

	private static class InputReader {

		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;

		public InputReader(InputStream st) {
			this.stream = st;
		}

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

	}

	//INPUT SHORTCUTS

	private static int[] ina(int n) {
		int[] temp = new int[n];
		for (int i = 0; i < n; i++) {
			temp[i] = in.nextInt();
		}
		return temp;
	}

	private static int ini() {
		return in.nextInt();
	}

	//OTHER SHORTCUTS
	public static void sort(int[] a) {
		Arrays.sort(a);
	}

	//PRINT SHORTCUTS

	private static void println(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static void print(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.flush();
	}

	private static void debug(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static HashMap<Integer, ArrayList<Integer>> intree(int n) {

		HashMap<Integer, ArrayList<Integer>> g = new HashMap<>();
		for (int i = 0; i < n; i++) {
			g.put(i, new ArrayList<>());
		}

		for (int i = 0; i < n - 1; i++) {
			int u = ini() - 1;
			int v = ini() - 1;
			g.get(u).add(v);
			g.get(v).add(u);
		}

		return g;
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.InputMismatchException;

public class B {
	private static int n;
	private static int[] a;

	public static void main(String[] args) {
		int t = in.nextInt();
		while (t-- > 0) {
			n = ini();
			a = ina(n);
			long sum = 0;
			for(int x: a) sum+=x;
			long sum2 = 0;
			int poss = 0;
			StringBuilder sb = new StringBuilder();
			HashSet<Integer> set = new HashSet<>();
			for(int i=0; i<n; i++) {
				sum2 += a[i];
				set.add(a[i]);
				if (set.size()==i+1 && sum2==(i+1)*1L*(i+2)/2 && sum-sum2==(n-i-1)*1L*(n-i)/2) {
					sb.append((i+1)+" "+(n-i-1)+"\n");
					poss++;
				}
			}

			println(poss);
			if (poss!=0)
				println(sb.toString().trim());
		}

		out.flush();
		out.close();

	}

	//NONPROBLEM CODE

	private static InputReader in = new InputReader(System.in);
	private static PrintWriter out = new PrintWriter(System.out);

	private static class InputReader {

		private final InputStream stream;
		private final byte[] buf = new byte[8192];
		private int curChar, snumChars;

		public InputReader(InputStream st) {
			this.stream = st;
		}

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = stream.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int a[] = new int[n];
			for (int i = 0; i < n; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public String readString() {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}

	}

	//INPUT SHORTCUTS

	private static int[] ina(int n) {
		int[] temp = new int[n];
		for (int i = 0; i < n; i++) {
			temp[i] = in.nextInt();
		}
		return temp;
	}

	private static int ini() {
		return in.nextInt();
	}

	//OTHER SHORTCUTS
	public static void sort(int[] a) {
		Arrays.sort(a);
	}

	//PRINT SHORTCUTS

	private static void println(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static void print(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.flush();
	}

	private static void debug(Object... o) {
		for (Object x : o) {
			out.write(x + " ");
		}
		out.write("\n");
		out.flush();
	}

	private static HashMap<Integer, ArrayList<Integer>> intree(int n) {

		HashMap<Integer, ArrayList<Integer>> g = new HashMap<>();
		for (int i = 0; i < n; i++) {
			g.put(i, new ArrayList<>());
		}

		for (int i = 0; i < n - 1; i++) {
			int u = ini() - 1;
			int v = ini() - 1;
			g.get(u).add(v);
			g.get(v).add(u);
		}

		return g;
	}
}


// Problem : B. Dreamoon Likes Permutations
// Contest : Codeforces Round #631 (Div. 2) - Thanks, Denis aramis Shitov!
// URL : https://codeforces.com/contest/1330/problem/B
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

import java.io.*;
import java.util.*;

public class a {

	public static void main(String[] args) {
		FastReader scan = new FastReader();
		PrintWriter out = new PrintWriter(System.out);
		Task solver = new Task();
		int t = scan.nextInt();
		//int t = 1;
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {

		public void solve(int testNumber, FastReader sc, PrintWriter pw) {
			int n = sc.nextInt();
			int[] arr= new int[n+1];
			int[] freq = new int[n+1];
			for(int i=0;i<n;i++){
				arr[i]=sc.nextInt();
				if(arr[i]>n){
					pw.println(0);
					return;
				}
			}
			HashSet<Integer> hs = new HashSet<Integer>();
			bit ch = new bit(n);

			for(int i=0;i<n;i++){
				ch.add(arr[i],1);
				freq[arr[i]]++;
				if(freq[arr[i]]>1)break;
				else{
					if(ch.sum(i+1)==i+1){
						hs.add(i+1);
					}
				}
			}
			//pw.println(hs);
			ArrayList<Integer> out=  new ArrayList<>();
			freq= new int[n+1];
			ch = new bit(n+1);
			for(int i=n-1;i>=0;i--){
				ch.add(arr[i],1);
				freq[arr[i]]++;
				if(freq[arr[i]]>1)break;
				else{
					if(hs.contains(i)&&ch.sum(n-i)==n-i){
						out.add(i);
					}
				}
			}
			pw.println(out.size());
			for(int x : out){
				pw.println(x+" "+(n-x));
			}
		}
		static class bit {
			int n;
			int[] bit;
			public bit(int n) {
				this.n=n;
				bit=new int[n+1];
			}
			void add(int ind, int c) {
				for(; ind<n;ind|=(ind+1)) {
					bit[ind]+=c;
				}
			}
			int sum(int r) {
				int out =0;
				for(;r>=0;r=(r&(r+1))-1) {
					out+=bit[r];
				}
				return out;
			}
			int sum(int r, int l) {
				return sum(r)-sum(l-1);
			}
		}
	}

	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void shuffle(long[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {

	static long sx = 0, sy = 0, mod = (long) (1e9 + 7);

	static ArrayList<Integer>[] a;
	static long[][][] dp;
	static int[] size;
	static long[] farr;
	public static PrintWriter out;
	static ArrayList<pair> pa = new ArrayList<>();
	static long[] fact = new long[(int) 1e6];
	static boolean b = false;
	static StringBuilder sb = new StringBuilder();
	static boolean cycle = false;
	// static long m = 998244353;
	static long[] no, col;
	static String s;
	static int k = 0, n = 0, m = 0;
	static int[] c;
	static long ans = 0;
	static long[][] p;
	static HashMap<Integer, Integer> hm;

	public static void main(String[] args) throws IOException {

		Scanner scn = new Scanner(new BufferedReader(new InputStreamReader(System.in)));

		out = new PrintWriter(System.out);
		// Reader scn = new Reader();

		int t = scn.nextInt();

		while (t-- != 0) {

			int n = scn.nextInt();

			int[] a = new int[n + 1];

			for (int i = 1; i <= n; i++)
				a[i] = scn.nextInt();

			int[] lmin = new int[n + 1];
			int[] lmax = new int[n + 1];
			int[] rmin = new int[n + 1];
			int[] rmax = new int[n + 1];

			boolean[] b1 = new boolean[n + 1];
			Arrays.fill(b1, true);
			boolean[] b2 = new boolean[n + 1];
			Arrays.fill(b2, true);
			HashSet<Integer> hm = new HashSet<>();

			lmin[1] = lmax[1] = a[1];

			rmin[n] = rmax[n] = a[n];

			hm.add(a[1]);

			for (int i = 2; i <= n; i++) {

				if (hm.contains(a[i]))
					b1[i] = false;

				b1[i] &= b1[i - 1];

				lmin[i] = Math.min(a[i], lmin[i - 1]);
				lmax[i] = Math.max(a[i], lmax[i - 1]);

				hm.add(a[i]);
			}

			hm = new HashSet<>();
			hm.add(a[n]);

			for (int i = n - 1; i >= 1; i--) {

				if (hm.contains(a[i]))
					b2[i] = false;

				b2[i] &= b2[i + 1];

				rmin[i] = Math.min(rmin[i + 1], a[i]);
				rmax[i] = Math.max(rmax[i + 1], a[i]);

				hm.add(a[i]);
			}

			int ans = 0;

			StringBuilder sb = new StringBuilder();

			for (int i = 1; i <= n - 1; i++) {

				if (lmin[i] == 1 && lmax[i] == i && rmin[i + 1] == 1 && rmax[i + 1] == n - i && b1[i] && b2[i+1]) {
					ans++;
					sb.append(i + " " + (n - i));
					sb.append("\n");
				}

				hm.add(a[i]);
			}

			System.out.println(ans);
			System.out.print(sb);

		}
	}

	// _________________________TEMPLATE_____________________________________________________________

	// public static long lcm(long x, long y) {
	//
	// return (x * y) / gcd(x, y);
	// }
	//
	// private static long gcd(long x, long y) {
	// if (x == 0)
	// return y;
	//
	// return gcd(y % x, x);
	// }

	// static class comp implements Comparator<Integer> {
	//
	// @Override
	// public int compare(Integer o1, Integer o2) {
	// return depth[o2] - depth[o1];
	// }
	//
	// }

	// public static long pow(long a, long b) {
	//
	// if (b < 0)
	// return 0;
	// if (b == 0 || b == 1)
	// return (long) Math.pow(a, b);
	//
	// if (b % 2 == 0) {
	//
	// long ret = pow(a, b / 2);
	// ret = (ret % mod * ret % mod) % mod;
	// return ret;
	// }
	//
	// else {
	// return ((pow(a, b - 1) % mod) * a % mod) % mod;
	// }
	// }

	private static class pair implements Comparable<pair> {

		int w, h;
		int idx;

		pair(int a, int b, int i) {

			w = a;
			h = b;
			idx = i;
		}

		@Override
		public int compareTo(pair o) {

			if (this.w != o.w)
				return this.w - o.w;

			else
				return this.h - o.h;
		}

	}

	private static String reverse(String s) {

		return new StringBuilder(s).reverse().toString();
	}

	public static class Reader {
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException {
			byte[] buf = new byte[1000000 + 1]; // line length
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();

			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (c == '.') {
				while ((c = read()) >= '0' && c <= '9') {
					ret += (c - '0') / (div *= 10);
				}
			}

			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) throws IOException {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		public int[][] nextInt2DArray(int m, int n) throws IOException {
			int[][] arr = new int[m][n];
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < n; j++)
					arr[i][j] = nextInt();
			}
			return arr;
		}

		public long[][] nextInt2DArrayL(int m, int n) throws IOException {
			long[][] arr = new long[m][n];
			for (int i = 0; i < m; i++) {
				for (int j = 0; j < n; j++)
					arr[i][j] = nextInt();
			}
			return arr;
		}
		// kickstart - Solution
		// atcoder - Main
	}

}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int t = scan.nextInt();
		StringBuilder out = new StringBuilder();
		while (t-- > 0) {
			StringBuilder res = new StringBuilder();
			int n = scan.nextInt();
			int total = 0;
			int[] ar = new int[n + 1];
			for (int i = 1; i <= n; i++) {
				ar[i] = scan.nextInt();
			}

			int[] mark = new int[n + 1];
			int[] count = new int[n + 1];
			int maxNumber = 0;
			int i = 1;
			for (; i <= n; i++) {
				count[ar[i]]++;
				maxNumber = Math.max(maxNumber, ar[i]);
				if (count[ar[i]] > 1) {
					break;
				}
				if (maxNumber == i) {
					mark[i] = maxNumber;
				}
			}

			count = new int[n + 1];
			maxNumber = 0;
			for (int j = n; j > 0; j--) {
				count[ar[j]]++;
				if (count[ar[j]] > 1) {
					break;
				}
				maxNumber = Math.max(maxNumber, ar[j]);
				if (maxNumber == (n - j + 1) && mark[j - 1] != 0) {
					total++;
					res.append(mark[j - 1] + " " + maxNumber + "\n");
				}
			}

			out.append(total + "\n" + res.toString());
		}
		System.out.println(out.toString());

	}

}


// package day75;

import java.util.HashSet;
import java.util.Scanner;

public class Codeforces1330B {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		StringBuilder sb = new StringBuilder();
		for(int tt =0 ;tt< t;tt++) {
			int n=sc.nextInt();
		    int[] arr=new int[n+1];
		    int max=0;
		    for(int i=1;i<=n;i++){
		        arr[i]=sc.nextInt();
		        max=Math.max(max,arr[i]);
		    }
		    int min=n-max;
		    HashSet<Integer> hs=new HashSet<>();
		    boolean z1=true;
		    for(int i=1;i<=max;i++)hs.add(arr[i]);
		    for(int i=1;i<=max;i++){
		        if(!hs.contains(i)){
		            z1=false;
		            break;
		        }
		    }
		    if(z1){
		        hs=new HashSet<>();
		        for(int i=max+1;i<=n;i++)hs.add(arr[i]);
		        for(int i=1;i<=min;i++){
		            if(!hs.contains(i)){
		                z1=false;
		                break;
		            }
		        }

		    }
		    boolean z2=true;
		    hs=new HashSet<>();
		    for(int i=1;i<=min;i++)hs.add(arr[i]);
		    for(int i=1;i<=min;i++){
		        if(!hs.contains(i)){
		            z2=false;
		            break;
		        }
		    }
		    if(z2){
		        hs=new HashSet<>();
		        for(int i=min+1;i<=n;i++)hs.add(arr[i]);
		        for(int i=1;i<=max;i++){
		            if(!hs.contains(i)){
		                z2=false;
		                break;
		            }
		        }
		    }
	    	if(z1 && z2 && max!=min)sb.append(2+"\n"+max+" "+min+"\n"+min+" "+max+"\n");
	    	else if(z1)sb.append(1+"\n"+max+" "+min+"\n");
	    	else if(z2)sb.append(1+"\n"+min+" "+max+"\n");
	    	else sb.append(0+"\n");
		}
		System.out.println(sb);
		sc.close();

	}

}


// package day75;

import java.util.Arrays;
import java.util.Scanner;

public class Codeforces1330B {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		StringBuilder sb = new StringBuilder();
outer:	for(int tt =0 ;tt< t;tt++) {
			int n = sc.nextInt();
			boolean forward = true;
			boolean backward = true;
			int a[] = new int[200000];
			int b[] = new int[n];
			for(int i = 0 ;i < n ; i++) {
				int p = sc.nextInt();
				a[p]++;
				b[i] = p;
			}
			int last = 0;
			for(int i = 1 ; i < n ;i++) {
				if(a[i] == 2)last = i;
				else break;
			}

			for(int i = last + 1 ; i < n ; i++) {
				if(a[i] == 2) {
					sb.append("0\n");
					continue outer;
				}
			}
			Arrays.fill(a, 0);
			for(int i = 0 ; i < last ;i++) {
				a[b[i]]++;
			}

			for(int i = 1 ; i <= last ; i++) {
				if(a[i] != 1) {
					forward = false;
				}
			}
			Arrays.fill(a, 0);
			for(int i = last ; i < n ;i++) {
				a[b[i]]++;
			}

			for(int i = 1 ; i < n - last ; i++) {
				if(a[i] != 1) {
					forward = false;
				}
			}
//
			last = n - last;
			Arrays.fill(a, 0);
			for(int i = 0 ; i < last ;i++) {
				a[b[i]]++;
			}
			for(int i = 1 ; i <= last ; i++) {
				if(a[i] != 1) {
					backward = false;
				}
				a[i] = 0;
			}
			Arrays.fill(a, 0);
			for(int i = last ; i < n ;i++) {
				a[b[i]]++;
			}

			for(int i = 1 ; i < n - last ; i++) {
				if(a[i] != 1) {
					backward = false;
				}
				a[i] = 0;
			}
			if(forward && backward) {
				sb.append(2 + "\n");
				sb.append(last + " " + (n - last)+"\n");
				sb.append((n - last) + " " + last+"\n");
			}else if(forward || backward) {
				sb.append(1+"\n");
				if(forward) {
					sb.append((n - last) + " " + last+"\n");
				}else {
					sb.append(last + " " + (n - last)+"\n");
				}
			}else {
				sb.append(0+"\n");
			}

		}
		System.out.println(sb);
		sc.close();

	}

}


// package day75;

import java.util.Arrays;
import java.util.Scanner;

public class Codeforces1330B {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
outer:	for(int tt =0 ;tt< t;tt++) {
			int n = sc.nextInt();
			boolean forward = true;
			boolean backward = true;
			int a[] = new int[200000];
			int b[] = new int[n];
			for(int i = 0 ;i < n ; i++) {
				int p = sc.nextInt();
				a[p]++;
				b[i] = p;
			}
			int last = 0;
			for(int i = 1 ; i < n ;i++) {
				if(a[i] == 2)last = i;
				else break;
			}

			for(int i = last + 1 ; i < n ; i++) {
				if(a[i] == 2) {
					System.out.println("0");
					continue outer;
				}
			}
			Arrays.fill(a, 0);
			for(int i = 0 ; i < last ;i++) {
				a[b[i]]++;
			}

			for(int i = 1 ; i <= last ; i++) {
				if(a[i] != 1) {
					forward = false;
				}
			}
			Arrays.fill(a, 0);
			for(int i = last ; i < n ;i++) {
				a[b[i]]++;
			}

			for(int i = 1 ; i < n - last ; i++) {
				if(a[i] != 1) {
					forward = false;
				}
			}
//
			last = n - last;
			Arrays.fill(a, 0);
			for(int i = 0 ; i < last ;i++) {
				a[b[i]]++;
			}
			for(int i = 1 ; i <= last ; i++) {
				if(a[i] != 1) {
					backward = false;
				}
				a[i] = 0;
			}
			Arrays.fill(a, 0);
			for(int i = last ; i < n ;i++) {
				a[b[i]]++;
			}

			for(int i = 1 ; i < n - last ; i++) {
				if(a[i] != 1) {
					backward = false;
				}
				a[i] = 0;
			}
			if(forward && backward) {
				System.out.println(2);
				System.out.println(last + " " + (n - last));
				System.out.println((n - last) + " " + last);
			}else if(forward || backward) {
				System.out.println(1);
				if(forward) {
					System.out.println((n - last) + " " + last);
				}else {
					System.out.println(last + " " + (n - last));
				}
			}else {
				System.out.println(0);
			}

		}
		sc.close();

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class template {

	final static int MAXN = 100_005;
	final static long MOD = (long) 1e9 + 7;

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int t = sc.nextInt();
		StringBuilder sb = new StringBuilder();
outer:	for(int tt =0 ;tt< t;tt++) {
			int n = sc.nextInt();
			boolean forward = true;
			boolean backward = true;
			int a[] = new int[200000];
			int b[] = new int[n];
			for(int i = 0 ;i < n ; i++) {
				int p = sc.nextInt();
				a[p]++;
				b[i] = p;
			}
			int last = 0;
			for(int i = 1 ; i < n ;i++) {
				if(a[i] == 2)last = i;
				else break;
			}

			for(int i = last + 1 ; i < n ; i++) {
				if(a[i] == 2) {
					sb.append("0\n");
					continue outer;
				}
			}
			Arrays.fill(a, 0);
			for(int i = 0 ; i < last ;i++) {
				a[b[i]]++;
			}

			for(int i = 1 ; i <= last ; i++) {
				if(a[i] != 1) {
					forward = false;
				}
			}
			Arrays.fill(a, 0);
			for(int i = last ; i < n ;i++) {
				a[b[i]]++;
			}

			for(int i = 1 ; i < n - last ; i++) {
				if(a[i] != 1) {
					forward = false;
				}
			}
//
			last = n - last;
			Arrays.fill(a, 0);
			for(int i = 0 ; i < last ;i++) {
				a[b[i]]++;
			}
			for(int i = 1 ; i <= last ; i++) {
				if(a[i] != 1) {
					backward = false;
				}
				a[i] = 0;
			}
			Arrays.fill(a, 0);
			for(int i = last ; i < n ;i++) {
				a[b[i]]++;
			}

			for(int i = 1 ; i < n - last ; i++) {
				if(a[i] != 1) {
					backward = false;
				}
				a[i] = 0;
			}
			if(forward && backward) {
				sb.append(2 + "\n");
				sb.append(last + " " + (n - last)+"\n");
				sb.append((n - last) + " " + last+"\n");
			}else if(forward || backward) {
				sb.append(1+"\n");
				if(forward) {
					sb.append((n - last) + " " + last+"\n");
				}else {
					sb.append(last + " " + (n - last)+"\n");
				}
			}else {
				sb.append(0+"\n");
			}

		}
		System.out.println(sb);
	}

	public static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}

    public static long[] factorial;

    public static void setFactorial() {
        factorial = new long[MAXN];
        factorial[0] = 1;
        for (int i = 1; i < MAXN; ++i) factorial[i] = factorial[i - 1] * i % MOD;
    }

    public static long getFactorial(int n) {
        if (factorial == null) setFactorial();
        return factorial[n];
    }

    public static long ncr(int n, int r) {
        if (r > n) return 0;
        if (factorial == null) setFactorial();
        long numerator = factorial[n];
        long denominator = factorial[r] * factorial[n - r] % MOD;
        return numerator * pow(denominator, MOD - 2, MOD) % MOD;
    }

    public static long gcd(long a, long b) {
        return b == 0 ? a : gcd(b, a % b);
    }

    public static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, a % b);
    }
    public static long pow(long base, long exp, long MOD) {
        base %= MOD;
        long ret = 1;
        while (exp > 0) {
            if ((exp & 1) == 1) ret = ret * base % MOD;
            base = base * base % MOD;
            exp >>= 1;
        }
        return ret;
    }

    public static long max(long... ar) {
        long ret = ar[0];
        for (long itr : ar) ret = Math.max(ret, itr);
        return ret;
    }

    public static int max(int... ar) {
        int ret = ar[0];
        for (int itr : ar) ret = Math.max(ret, itr);
        return ret;
    }

    public static long min(long... ar) {
        long ret = ar[0];
        for (long itr : ar) ret = Math.min(ret, itr);
        return ret;
    }

    public static int min(int... ar) {
        int ret = ar[0];
        for (int itr : ar) ret = Math.min(ret, itr);
        return ret;
    }

    public static long sum(long... ar) {
        long sum = 0;
        for (long itr : ar) sum += itr;
        return sum;
    }

    public static long sum(int... ar) {
        long sum = 0;
        for (int itr : ar) sum += itr;
        return sum;
    }

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");

		public String next() {
			while (!st.hasMoreElements())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
	}

}


/**
 * Author: Rohan Arora(codiinggeek)
 */

import java.io.*;
import java.util.*;

public class forces {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args) {
        try {
            FastReader s = new FastReader();
            int t = s.nextInt();
            while(t-->0){
                int n = s.nextInt();
                int ar[] = new int[n];
                int l[] = new int[n];
                int r[] = new int[n];
                int w=0;
                PriorityQueue<Integer> lheap = new PriorityQueue<>(new Comparator<Integer>() {
                    @Override
                    public int compare(Integer o1, Integer o2) {
                        return o2.compareTo(o1);
                    }
                });
                int y=0;
                for(int i=0;i<n;i++){
                    ar[i] = s.nextInt();
                    if(w==0){
                        if(lheap.contains(ar[i])){
                            w=1;
                        }
                        if(w!=1){
                            lheap.add(ar[i]);
                            y = lheap.size();
                            if(y==lheap.peek()){
                                l[i] =1;
                            }
                        }
                    }
                }

                /*for(int i=0;i<n;i++){
                    if(lheap.contains(ar[i])){
                        break;
                    }
                    lheap.add(ar[i]);
                    y = lheap.size();
                    if(y==lheap.peek()){
                        l[i] =1;
                    }
                }*/

                PriorityQueue<Integer> rheap = new PriorityQueue<>(new Comparator<Integer>() {
                    @Override
                    public int compare(Integer o1, Integer o2) {
                        return o2.compareTo(o1);
                    }
                });
                for(int i=n-1;i>=0;i--){
                    if(rheap.contains(ar[i])){
                        break;
                    }
                    rheap.add(ar[i]);
                    y = rheap.size();
                    if(y==rheap.peek()){
                        r[i]=1;
                    }
                }
                y=0;
                int ans[] = new int[n];
                for(int i=0;i<n-1;i++){
                    //System.out.println(l[i]+" "+r[i+1]);
                    if(l[i]+r[i+1]==2){
                      //  System.out.println("i: "+i);
                        ans[y] =i;
                        y++;
                    }
                }
                System.out.println(y);
                for(int i=0;i<y;i++){
                        System.out.println((ans[i]+1)+" "+(n-(ans[i]+1)));
                }
            }
        } catch (Exception e) {
            System.out.println(e);
            return;
        }
    }
}


/**
 * Author: Rohan Arora(codiinggeek)
 */

import java.io.*;
import java.util.*;

public class forces {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args) {
        try {
            FastReader s = new FastReader();
            int t = s.nextInt();
            while(t-->0) {
                int n = s.nextInt();
                int ar[] = new int[n+1];
                for(int i=1;i<=n;i++){
                    ar[i] = s.nextInt();
                }
                boolean l[] = new boolean[n+1];
                boolean r[] = new boolean[n+1];
                boolean used[] = new boolean[n+1];
                int max=-1;
                int y=0;
                for(int i=1;i<=n;i++){
                    int p = ar[i];
                    max = Math.max(p,max);
                    if(!used[p]){
                        used[p]=true;
                        y++;
                    }else{
                        break;
                    }
                    if(max==i&&y==i){
                        l[i]=true;
                    }
                }
               Arrays.fill(used,false);
                /*for(int i=1;i<=n;i++){
                    System.out.print(ar[i]+" ");
                }*/
                //System.out.println("");
                max=-1;
                y=0;
                for(int i=n;i>=1;i--){
                    int p=ar[i];
                    max = Math.max(p,max);
                    if(!used[p]){
                        used[p]=true;
                       // System.out.println(p);
                        y++;
                    }else{
                        break;
                    }
                    if(max==(n-i+1)&&y==(n-i+1)){
                        r[i]=true;
                    }
                }
                int c = 0;
                for(int i=1;i<n;i++){
                    //System.out.println(l[i]+" "+r[i+1]);
                    if(l[i]&&r[i+1]){
                        c++;
                      //  System.out.println(i+" "+(n-i));
                    }
                }
                System.out.println(c);
                for(int i=1;i<n;i++){
                    if(l[i]&&r[i+1]){
                        System.out.println(i+" "+(n-i));
                    }
                }

            }
        } catch (Exception e) {
            System.out.println(e);
            return;
        }
    }
}


/**
 * Author: Rohan Arora(codiinggeek)
 */

import java.io.*;
import java.util.*;

public class forces {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    public static void main(String[] args) {
        try {
            FastReader s = new FastReader();
            int t = s.nextInt();
            while(t-->0){
                int n = s.nextInt();
                int ar[] = new int[n];
                int l[] = new int[n];
                int r[] = new int[n];
                for(int i=0;i<n;i++){
                    ar[i] = s.nextInt();
                }
                PriorityQueue<Integer> lheap = new PriorityQueue<>(new Comparator<Integer>() {
                    @Override
                    public int compare(Integer o1, Integer o2) {
                        return o2.compareTo(o1);
                    }
                });
                int y=0;
                for(int i=0;i<n;i++){
                    if(lheap.contains(ar[i])){
                        break;
                    }
                    lheap.add(ar[i]);
                    y = lheap.size();
                    if(y==lheap.peek()){
                        l[i] =1;
                    }
                }

                PriorityQueue<Integer> rheap = new PriorityQueue<>(new Comparator<Integer>() {
                    @Override
                    public int compare(Integer o1, Integer o2) {
                        return o2.compareTo(o1);
                    }
                });
                for(int i=n-1;i>=0;i--){
                    if(rheap.contains(ar[i])){
                        break;
                    }
                    rheap.add(ar[i]);
                    y = rheap.size();
                    if(y==rheap.peek()){
                        r[i]=1;
                    }
                }
                y=0;
                int ans[] = new int[n];
                for(int i=0;i<n-1;i++){
                    if(l[i]+r[i+1]==2){
                        ans[i] =1;
                        y++;
                    }
                }
                System.out.println(y);
                for(int i=0;i<n;i++){
                    if(ans[i]==1){
                        System.out.println((i+1)+" "+(n-(i+1)));
                    }
                }
            }
        } catch (Exception e) {
            System.out.println(e);
            return;
        }
    }
}


import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.util.Vector;

import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.pow;
import static java.util.Arrays.sort;

public class cf {
    static final Scanner sc = new Scanner(System.in);
    static final int mod = (int) (1e9 + 7);
    static final Reader r = new Reader();
    static final PrintWriter out = new PrintWriter(System.out);

    public static void main(final String[] args) throws IOException {
        int testcases = r.nextInt();
        while (testcases-- > 0) {
            extracted();
        }
        out.flush();
        out.close();
        sc.close();
    }

    private static void extracted() throws IOException {
        int n = r.nextInt();
        int[] a = new int[n];
        int k = 0;
        Set<Integer> s1 = new TreeSet<>();Set<Integer> s2 = new TreeSet<>();
        long p1=0,p2=0,l1,l2;
        for (int i = 0; i < a.length; i++) {
            a[i] = r.nextInt();
        }
        boolean b=false,se1=false,se2=false;
        for (int i = 0; i < a.length; i++) {
            if(!s1.contains(a[i])&&!b) {s1.add(a[i]); p1+=a[i];  }else{b=true;}
             if(b&&!s2.contains(a[i])){ s2.add(a[i]);   p2+=a[i];}
            else if(b) { break;}
        }
        l1=s1.size();l2=s2.size();
        if (l1*(l1+1)/2==p1&&l2*(l2+1)/2==p2&&(l1+l2)==n) {
            k++;se1=true;
        }
        s1 = new TreeSet<>();s2 = new TreeSet<>();
        p1=0;p2=0;long l3=l1,l4=l2;l1=0;l2=0;
        b=false;
        for (int i = n-1; i >-1; --i) {
            if(!s1.contains(a[i])&&!b) {s1.add(a[i]); p1+=a[i];  }else{b=true;}
            if(b&&!s2.contains(a[i])){ s2.add(a[i]);   p2+=a[i];}
            else if(b) { break;}
        }
        l1=s1.size();l2=s2.size();
        if (l1*(l1+1)/2==p1&&l2*(l2+1)/2==p2&&(l1+l2)==n) {
            k++;se2=true;
        }
        if(l3==l2&&l1==l4){k--;se2=false;}
        out.println(k);
        if(se1)out.println(l3+" "+l4);
        if(se2)out.println(l2+" "+l1);
    }

    static int gcd(int a, int b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private final DataInputStream din;
        private final byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(final String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException {
            final byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null)
                return;
            din.close();
        }
    }
}


import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.util.Vector;

import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.pow;
import static java.util.Arrays.sort;

public class cf {
    static final Scanner sc = new Scanner(System.in);
    static final int mod = (int) (1e9 + 7);
    static final Reader r = new Reader();
    static final PrintWriter out = new PrintWriter(System.out);

    public static void main(final String[] args) throws IOException {
        int testcases = r.nextInt();
        while (testcases-- > 0) {
            extracted();
        }
        out.flush();
        out.close();
        sc.close();
    }

    private static void extracted() throws IOException {
        int n = r.nextInt();
        int[] a = new int[n];
        int k = 0;
        Set<Integer> s1 = new TreeSet<>();Set<Integer> s2 = new TreeSet<>();
        long p1=0,p2=0,l1,l2;
        for (int i = 0; i < a.length; i++) {
            a[i] = r.nextInt();
        }
        boolean b=false,se1=false,se2=false;
        for (int i = 0; i < a.length; i++) {
            if(!s1.contains(a[i])&&!b) {s1.add(a[i]); p1+=a[i];  }else{b=true;}
             if(b&&!s2.contains(a[i])){ s2.add(a[i]);   p2+=a[i];}
            else if(b) { break;}
        }
        l1=s1.size();l2=s2.size();
        if (l1*(l1+1)/2==p1&&l2*(l2+1)/2==p2&&(l1+l2)==n) {
            k++;se1=true;
        }
        s1 = new TreeSet<>();s2 = new TreeSet<>();
        p1=0;p2=0;long l3=l1,l4=l2;l1=0;l2=0;
        b=false;
        for (int i = n-1; i >-1; --i) {
            if(!s1.contains(a[i])&&!b) {s1.add(a[i]); p1+=a[i];  }else{b=true;}
            if(b&&!s2.contains(a[i])){ s2.add(a[i]);   p2+=a[i];}
            else if(b) { break;}
        }
        l1=s1.size();l2=s2.size();
        if (l1*(l1+1)/2==p1&&l2*(l2+1)/2==p2&&(l1+l2)==n) {
            k++;se2=true;
        }
        if(k>1&&l3==l2&&l1==l4){k--;se2=false;}
        out.println(k);
        if(se1)out.println(l3+" "+l4);
        if(se2)out.println(l2+" "+l1);
    }

    static int gcd(int a, int b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private final DataInputStream din;
        private final byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(final String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException {
            final byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null)
                return;
            din.close();
        }
    }
}


import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
import java.util.Vector;

import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.pow;
import static java.util.Arrays.sort;

public class cf {
    static final Scanner sc = new Scanner(System.in);
    static final int mod = (int) (1e9 + 7);
    static final Reader r = new Reader();
    static final PrintWriter out = new PrintWriter(System.out);

    public static void main(final String[] args) throws IOException {
        int testcases = r.nextInt();
        while (testcases-- > 0) {
            extracted();
        }
        out.flush();
        out.close();
        sc.close();
    }

    private static void extracted() throws IOException {
        int n = r.nextInt();
        int[] a = new int[n];
        int k = 0;
        Set<Integer> s1 = new TreeSet<>();Set<Integer> s2 = new TreeSet<>();
        long p1=0,p2=0,l1,l2;
        for (int i = 0; i < a.length; i++) {
            a[i] = r.nextInt();
        }
        boolean b=false,se1=false,se2=false;
        for (int i = 0; i < a.length; i++) {
            if(!s1.contains(a[i])&&!b) {s1.add(a[i]); p1+=a[i];  }else{b=true;}
             if(b&&!s2.contains(a[i])){ s2.add(a[i]);   p2+=a[i];}
            else if(b) { break;}
        }
        l1=s1.size();l2=s2.size();
        if (l1*(l1+1)/2==p1&&l2*(l2+1)/2==p2&&(l1+l2)==n) {
            k++;se1=true;
        }
        s1 = new TreeSet<>();s2 = new TreeSet<>();
        p1=0;p2=0;long l3=l1,l4=l2;l1=0;l2=0;
        b=false;
        for (int i = n-1; i >-1; --i) {
            if(!s1.contains(a[i])&&!b) {s1.add(a[i]); p1+=a[i];  }else{b=true;}
            if(b&&!s2.contains(a[i])){ s2.add(a[i]);   p2+=a[i];}
            else if(b) { break;}
        }
        l1=s1.size();l2=s2.size();
        if (l1*(l1+1)/2==p1&&l2*(l2+1)/2==p2&&(l1+l2)==n) {
            k++;se2=true;
        }
        out.println(k);
        if(se1)out.println(l3+" "+l4);
        if(se2)out.println(l2+" "+l1);
    }

    static int gcd(int a, int b) {
        if (b == 0)
            return a;
        return gcd(b, a % b);
    }

    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private final DataInputStream din;
        private final byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(final String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException {
            final byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            final boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null)
                return;
            din.close();
        }
    }
}


import java.util.*;
import java.io.*;
public class Solution{
	public static void main(String[] args){
		Scanner in=new Scanner(System.in);
		int t=in.nextInt();
		while(t-->0){
			int n=in.nextInt();
			long[] a=new long[n];
			for(int i=0;i<n;i++)a[i]=in.nextLong();
			long[] pre=new long[n];
			pre[0]=a[0];
			for(int i=1;i<n;i++){
				pre[i]=pre[i-1]+a[i];
			}
			StringBuilder ans=new StringBuilder("");
			int cnt=0;
			TreeSet<Long> ts=new TreeSet<Long>();
			long min=a[0],max=a[0];
			ts.add(a[0]);
			for(int i=1;i<n;i++){
				long x=i*(i+1);
				x/=2;
				long y=(n-i)*(n-i+1);
				y/=2;
				if(pre[i-1]==x && pre[n-1]-pre[i-1]==y && max==i && min==1 && ts.size()==i){
					cnt+=1;
					ans.append(i+" ");
					ans.append(n-i+"\n");
				}
				ts.add(a[i]);
				max=Math.max(max,a[i]);min=Math.min(min,a[i]);
			}
			System.out.println(cnt);
			System.out.print(ans);
		}
	}
}


import java.util.*;
import java.io.*;
public class Solution{
	public static void main(String[] args){
		Scanner in=new Scanner(System.in);
		int t=in.nextInt();
		while(t-->0){
			int n=in.nextInt();
			long[] a=new long[n];
			for(int i=0;i<n;i++)a[i]=in.nextLong();
			long[] pre=new long[n];
			pre[0]=a[0];
			for(int i=1;i<n;i++){
				pre[i]=pre[i-1]+a[i];
			}
			StringBuilder ans=new StringBuilder("");
			int cnt=0;
			for(int i=1;i<n;i++){
				long x=i*(i+1);
				x/=2;
				long y=(n-i)*(n-i+1);
				y/=2;
				if(pre[i-1]==x && pre[n-1]-pre[i-1]==y){
					cnt+=1;
					ans.append(i+" ");
					ans.append(n-i+"\n");
				}
			}
			System.out.println(cnt);
			System.out.print(ans);
		}
	}
}


import java.util.*;
import java.io.*;
public class Solution{
	public static void main(String[] args){
		Scanner in=new Scanner(System.in);
		int t=in.nextInt();
		while(t-->0){
			int n=in.nextInt();
			long[] a=new long[n];
			for(int i=0;i<n;i++)a[i]=in.nextLong();
			long[] pre=new long[n];
			pre[0]=a[0];
			for(int i=1;i<n;i++){
				pre[i]=pre[i-1]+a[i];
			}
			StringBuilder ans=new StringBuilder("");
			int cnt=0;
			TreeSet<Long> ts=new TreeSet<Long>();
			long min=a[0],max=a[0];
			ts.add(a[0]);
			long[] amax=new long[n];long[] amin=new long[n];long[] back=new long[n];
			amax[n-1]=a[n-1];amin[n-1]=a[n-1];
			TreeSet<Long> ts1=new TreeSet<Long>();
			ts1.add(a[n-1]);
			back[n-1]=ts1.size();
			for(int i=n-2;i>=0;i--){
				amax[i]=Math.max(amax[i+1],a[i]);amin[i]=Math.min(amin[i+1],a[i]);
				ts1.add(a[i]);
				back[i]=ts1.size();
			}
			for(int i=1;i<n;i++){
				long x=i*(i+1);
				x/=2;
				long y=(n-i)*(n-i+1);
				y/=2;
				//System.out.println(back[i]+" "+amax[i]+" "+amin[i]);
				if(pre[i-1]==x && pre[n-1]-pre[i-1]==y && max==i && min==1 && ts.size()==i && amax[i]==n-i && amin[i]==1 && back[i]==n-i){
					cnt+=1;
					ans.append(i+" ");
					ans.append(n-i+"\n");
				}
				ts.add(a[i]);
				max=Math.max(max,a[i]);min=Math.min(min,a[i]);
			}
			System.out.println(cnt);
			System.out.print(ans);
		}
	}
}


import java.util.*;
import java.io.*;
public class Solution{
	public static void main(String[] args){
		Scanner in=new Scanner(System.in);
		int t=in.nextInt();
		while(t-->0){
			int n=in.nextInt();
			long[] a=new long[n];
			for(int i=0;i<n;i++)a[i]=in.nextLong();
			long[] pre=new long[n];
			pre[0]=a[0];
			for(int i=1;i<n;i++){
				pre[i]=pre[i-1]+a[i];
			}
			StringBuilder ans=new StringBuilder("");
			int cnt=0;
			TreeSet<Long> ts=new TreeSet<Long>();
			long min=a[0],max=a[0];
			ts.add(a[0]);
			long[] amax=new long[n];long[] amin=new long[n];long[] back=new long[n];
			TreeSet<Long> ts1=new TreeSet<Long>();
			for(int i=n-1;i>=0;i--){
				amax[i]=Math.max(amax[i],a[i]);amin[i]=Math.min(amin[i],a[i]);
				ts1.add(a[i]);
				back[i]=ts1.size();
			}
			for(int i=1;i<n;i++){
				long x=i*(i+1);
				x/=2;
				long y=(n-i)*(n-i+1);
				y/=2;
				if(pre[i-1]==x && pre[n-1]-pre[i-1]==y && max==i && min==1 && ts.size()==i && amax[i]==n-i && amin[i]==1 && back[i]==n-i){
					cnt+=1;
					ans.append(i+" ");
					ans.append(n-i+"\n");
				}
				ts.add(a[i]);
				max=Math.max(max,a[i]);min=Math.min(min,a[i]);
			}
			System.out.println(cnt);
			System.out.print(ans);
		}
	}
}


import java.util.*;
import java.io.*;
public class Solution{
	public static void main(String[] args){
		Scanner in=new Scanner(System.in);
		int t=in.nextInt();
		while(t-->0){
			int n=in.nextInt();
			long[] a=new long[n];
			for(int i=0;i<n;i++)a[i]=in.nextLong();
			long[] pre=new long[n];
			pre[0]=a[0];
			for(int i=1;i<n;i++){
				pre[i]=pre[i-1]+a[i];
			}
			StringBuilder ans=new StringBuilder("");
			int cnt=0;
			TreeSet<Long> ts=new TreeSet<Long>();
			long min=a[0],max=a[0];
			ts.add(a[0]);
			long[] amax=new long[n];long[] amin=new long[n];long[] back=new long[n];
			amax[n-1]=a[n-1];amin[n-1]=a[n-1];
			TreeSet<Long> ts1=new TreeSet<Long>();
			ts1.add(a[n-1]);
			back[n-1]=ts1.size();
			for(int i=n-2;i>=0;i--){
				amax[i]=Math.max(amax[i+1],a[i]);amin[i]=Math.min(amin[i+1],a[i]);
				ts1.add(a[i]);
				back[i]=ts1.size();
			}
			for(int i=1;i<n;i++){
				//System.out.println(back[i]+" "+amax[i]+" "+amin[i]);
				if(max==i && min==1 && ts.size()==i && amax[i]==n-i && amin[i]==1 && back[i]==n-i){
					cnt+=1;
					ans.append(i+" ");
					ans.append(n-i+"\n");
				}
				ts.add(a[i]);
				max=Math.max(max,a[i]);min=Math.min(min,a[i]);
			}
			System.out.println(cnt);
			System.out.print(ans);
		}
	}
}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class Main {
	static final int INF = (int) (1e9 + 10);
	static final int MOD = (int) (1e9 + 7);

	// static final int N = (int) (4e5 + 5);
	// static ArrayList<Integer>[] graph;
	// static boolean visited[];
	// static long size[];

	public static void main(String[] args) throws NumberFormatException, IOException {
		FastReader sc = new FastReader();
		PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int t = sc.nextInt();
		while (t-- > 0) {
			int n = sc.nextInt();
		  //  int x = sc.nextInt();
		    int [] arr = new int[n];
		    long sum =0;
		  //  TreeSet<Integer> ts = new TreeSet<>();
		    for(int i =0 ; i < n; i++){
		        arr[i] = sc.nextInt();
		      //  ts.add(arr[i]);
		        sum += arr[i];
		    }
            ArrayList<String> list = new ArrayList<>();
            long curr =0;
            if(sum == ((n)*(n+1)/2)){
                list.add("0" + " " + Integer.toString(n));
            }
            for(int i =0 ; i < n ; i++){
                curr += arr[i];
                long pre = ((i+1)*(i+2))/2;
                long suff = ((n-i-1)*(n-i))/2;
                if(curr == pre && (sum-curr) == suff){

                    list.add(Integer.toString(i+1) + " " + Integer.toString(n-1-i));

                }
            }
            pr.println(list.size());
            for(String s : list){
                pr.println(s);
            }

		}

		pr.flush();
		pr.close();
	}

	/*
	 * Template From Here
	 */

	public static int lowerBound(ArrayList<Integer> array, int length, long value) {
		int low = 0;
		int high = length;
		while (low < high) {
			final int mid = (low + high) / 2;
			if (value <= array.get(mid)) {
				high = mid;
			} else {
				low = mid + 1;
			}
		}
		return low;
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static long gcd(long a, long b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	}

	public static void sortbyColumn(int[][] att, int col) {
		// Using built-in sort function Arrays.sort
		Arrays.sort(att, new Comparator<int[]>() {

			@Override
			// Compare values according to columns
			public int compare(final int[] entry1, final int[] entry2) {

				// To sort in descending order revert
				// the '>' Operator
				// if (entry1[col] > entry2[col])
				// return 1;
				// else //(entry1[col] >= entry2[col])
				// return -1;
				return new Integer(entry1[col]).compareTo(entry2[col]);
				// return entry1[col].
			}
		}); // End of function call sort().
	}

	static class pair {
		int V, I;

		pair(int v, int i) {
			V = v;
			I = i;
		}
	}

	public static int[] swap(int data[], int left, int right) {
		int temp = data[left];
		data[left] = data[right];
		data[right] = temp;
		return data;
	}

	public static int[] reverse(int data[], int left, int right) {
		while (left < right) {
			int temp = data[left];
			data[left++] = data[right];
			data[right--] = temp;
		}
		return data;
	}

	public static boolean findNextPermutation(int data[]) {
		if (data.length <= 1)
			return false;

		int last = data.length - 2;
		while (last >= 0) {
			if (data[last] < data[last + 1]) {
				break;
			}
			last--;
		}
		if (last < 0)
			return false;

		int nextGreater = data.length - 1;
		for (int i = data.length - 1; i > last; i--) {
			if (data[i] > data[last]) {
				nextGreater = i;
				break;
			}
		}
		data = swap(data, nextGreater, last);
		data = reverse(data, last + 1, data.length - 1);
		return true;
	}

	static long nCr(long n, long r) {
		if (n == r)
			return 1;
		return fact(n) / (fact(r) * fact(n - r));
	}

	static long fact(long n) {
		long res = 1;
		for (long i = 2; i <= n; i++)
			res = res * i;
		return res;
	}

	/*
	 * static boolean prime[] = new boolean[1000007];
	 *
	 * public static void sieveOfEratosthenes(int n) {
	 *
	 * for (int i = 0; i < n; i++) prime[i] = true; * for (int p = 2; p * p <=
	 * n; p++) { // If prime[p] is not changed, then it is a prime if (prime[p]
	 * == true) { // Update all multiples of p for (int i = p * p; i <= n; i +=
	 * p) prime[i] = false; } }
	 *
	 * // Print all prime numbers // for(int i = 2; i <= n; i++) // { //
	 * if(prime[i] == true) // System.out.print(i + " "); // } }
	 */

	static long power(long fac2, int y, int p) {
		long res = 1;
		fac2 = fac2 % p;
		while (y > 0) {
			if (y % 2 == 1)
				res = (res * fac2) % p;
			fac2 = (fac2 * fac2) % p;
		}
		return res;
	}

	static long modInverse(long fac2, int p) {
		return power(fac2, p - 2, p);
	}

	static boolean isPrime(int n) {
		// Corner cases
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		// This is checked so that we can skip
		// middle five numbers in below loop
		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}

	public static BigInteger lcmm(String a, String b) {
		BigInteger s = new BigInteger(a);
		BigInteger s1 = new BigInteger(b);
		BigInteger mul = s.multiply(s1);
		BigInteger gcd = s.gcd(s1);
		BigInteger lcm = mul.divide(gcd);
		return lcm;
	}

}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class Main {
	static final int INF = (int) (1e9 + 10);
	static final int MOD = (int) (1e9 + 7);

	// static final int N = (int) (4e5 + 5);
	// static ArrayList<Integer>[] graph;
	// static boolean visited[];
	// static long size[];

	public static void main(String[] args) throws NumberFormatException, IOException {
		FastReader sc = new FastReader();
		PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int t = sc.nextInt();
		while (t-- > 0) {
			int n = sc.nextInt();
		  //  int x = sc.nextInt();
		    int [] arr = new int[n];
		    long sum =0;

		    for(int i =0 ; i < n; i++){
		        arr[i] = sc.nextInt();
		      //  ts.add(arr[i]);
		        sum += arr[i];
		    }
		    TreeSet<Integer> set = new TreeSet<>();
		     TreeSet<Integer> ps = new TreeSet<>();
		     TreeSet<Integer> ss = new TreeSet<>();
            ArrayList<Integer> ans = new ArrayList<>();
            long curr =0;
            for(int i =0 ; i < n ; i++){
                if(ps.contains(arr[i])){
                    break;
                }
                ps.add(arr[i]);
                if(ps.last() == (i+1)){
                    set.add(i+1);
                }
            }
            for(int i =n-1 ; i >= 0 ; i-- ){
                if(ss.contains(arr[i])){
                    break;
                }
                ss.add(arr[i]);
                if(ss.last() == (n-i) && set.contains(i)){
                    // ans.add(s s.last());
                    ans.add(i);
                }
            }
            pr.println(ans.size());
            for(int a : ans){
                pr.println(a + " "+  (n-a));
            }

		}

		pr.flush();
		pr.close();
	}

	/*
	 * Template From Here
	 */

	public static int lowerBound(ArrayList<Integer> array, int length, long value) {
		int low = 0;
		int high = length;
		while (low < high) {
			final int mid = (low + high) / 2;
			if (value <= array.get(mid)) {
				high = mid;
			} else {
				low = mid + 1;
			}
		}
		return low;
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static long gcd(long a, long b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	}

	public static void sortbyColumn(int[][] att, int col) {
		// Using built-in sort function Arrays.sort
		Arrays.sort(att, new Comparator<int[]>() {

			@Override
			// Compare values according to columns
			public int compare(final int[] entry1, final int[] entry2) {

				// To sort in descending order revert
				// the '>' Operator
				// if (entry1[col] > entry2[col])
				// return 1;
				// else //(entry1[col] >= entry2[col])
				// return -1;
				return new Integer(entry1[col]).compareTo(entry2[col]);
				// return entry1[col].
			}
		}); // End of function call sort().
	}

	static class pair {
		int V, I;

		pair(int v, int i) {
			V = v;
			I = i;
		}
	}

	public static int[] swap(int data[], int left, int right) {
		int temp = data[left];
		data[left] = data[right];
		data[right] = temp;
		return data;
	}

	public static int[] reverse(int data[], int left, int right) {
		while (left < right) {
			int temp = data[left];
			data[left++] = data[right];
			data[right--] = temp;
		}
		return data;
	}

	public static boolean findNextPermutation(int data[]) {
		if (data.length <= 1)
			return false;

		int last = data.length - 2;
		while (last >= 0) {
			if (data[last] < data[last + 1]) {
				break;
			}
			last--;
		}
		if (last < 0)
			return false;

		int nextGreater = data.length - 1;
		for (int i = data.length - 1; i > last; i--) {
			if (data[i] > data[last]) {
				nextGreater = i;
				break;
			}
		}
		data = swap(data, nextGreater, last);
		data = reverse(data, last + 1, data.length - 1);
		return true;
	}

	static long nCr(long n, long r) {
		if (n == r)
			return 1;
		return fact(n) / (fact(r) * fact(n - r));
	}

	static long fact(long n) {
		long res = 1;
		for (long i = 2; i <= n; i++)
			res = res * i;
		return res;
	}

	/*
	 * static boolean prime[] = new boolean[1000007];
	 *
	 * public static void sieveOfEratosthenes(int n) {
	 *
	 * for (int i = 0; i < n; i++) prime[i] = true; * for (int p = 2; p * p <=
	 * n; p++) { // If prime[p] is not changed, then it is a prime if (prime[p]
	 * == true) { // Update all multiples of p for (int i = p * p; i <= n; i +=
	 * p) prime[i] = false; } }
	 *
	 * // Print all prime numbers // for(int i = 2; i <= n; i++) // { //
	 * if(prime[i] == true) // System.out.print(i + " "); // } }
	 */

	static long power(long fac2, int y, int p) {
		long res = 1;
		fac2 = fac2 % p;
		while (y > 0) {
			if (y % 2 == 1)
				res = (res * fac2) % p;
			fac2 = (fac2 * fac2) % p;
		}
		return res;
	}

	static long modInverse(long fac2, int p) {
		return power(fac2, p - 2, p);
	}

	static boolean isPrime(int n) {
		// Corner cases
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		// This is checked so that we can skip
		// middle five numbers in below loop
		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}

	public static BigInteger lcmm(String a, String b) {
		BigInteger s = new BigInteger(a);
		BigInteger s1 = new BigInteger(b);
		BigInteger mul = s.multiply(s1);
		BigInteger gcd = s.gcd(s1);
		BigInteger lcm = mul.divide(gcd);
		return lcm;
	}

}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class Main {
	static final int INF = (int) (1e9 + 10);
	static final int MOD = (int) (1e9 + 7);

	// static final int N = (int) (4e5 + 5);
	// static ArrayList<Integer>[] graph;
	// static boolean visited[];
	// static long size[];

	public static void main(String[] args) throws NumberFormatException, IOException {
		FastReader sc = new FastReader();
		PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int t = sc.nextInt();
		while (t-- > 0) {
			int n = sc.nextInt();
		  //  int x = sc.nextInt();
		    int [] arr = new int[n];
		    long sum =0;
		  //  TreeSet<Integer> ts = new TreeSet<>();
		    for(int i =0 ; i < n; i++){
		        arr[i] = sc.nextInt();
		      //  ts.add(arr[i]);
		        sum += arr[i];
		    }
            ArrayList<String> list = new ArrayList<>();
            long curr =0;
            for(int i =0 ; i < n ; i++){
                curr += arr[i];
                long pre = ((i+1)*(i+2))/2;
                long suff = ((n-i-1)*(n-i))/2;
                if(curr == pre && (sum-curr) == suff){
                    if(pre ==0){
                        list.add(Integer.toString(n) + " " + "0");
                        list.add( "0" + " "+ Integer.toString(n) );
                    }else if(suff ==0){
                        list.add(Integer.toString(n) + " " + "0");
                        list.add( "0" + " "+ Integer.toString(n) );
                    }else{
                    list.add(Integer.toString(i+1) + " " + Integer.toString(n-1-i));
                    }
                }
            }
            pr.println(list.size());
            for(String s : list){
                pr.println(s);
            }

		}

		pr.flush();
		pr.close();
	}

	/*
	 * Template From Here
	 */

	public static int lowerBound(ArrayList<Integer> array, int length, long value) {
		int low = 0;
		int high = length;
		while (low < high) {
			final int mid = (low + high) / 2;
			if (value <= array.get(mid)) {
				high = mid;
			} else {
				low = mid + 1;
			}
		}
		return low;
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static long gcd(long a, long b) {
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	}

	public static void sortbyColumn(int[][] att, int col) {
		// Using built-in sort function Arrays.sort
		Arrays.sort(att, new Comparator<int[]>() {

			@Override
			// Compare values according to columns
			public int compare(final int[] entry1, final int[] entry2) {

				// To sort in descending order revert
				// the '>' Operator
				// if (entry1[col] > entry2[col])
				// return 1;
				// else //(entry1[col] >= entry2[col])
				// return -1;
				return new Integer(entry1[col]).compareTo(entry2[col]);
				// return entry1[col].
			}
		}); // End of function call sort().
	}

	static class pair {
		int V, I;

		pair(int v, int i) {
			V = v;
			I = i;
		}
	}

	public static int[] swap(int data[], int left, int right) {
		int temp = data[left];
		data[left] = data[right];
		data[right] = temp;
		return data;
	}

	public static int[] reverse(int data[], int left, int right) {
		while (left < right) {
			int temp = data[left];
			data[left++] = data[right];
			data[right--] = temp;
		}
		return data;
	}

	public static boolean findNextPermutation(int data[]) {
		if (data.length <= 1)
			return false;

		int last = data.length - 2;
		while (last >= 0) {
			if (data[last] < data[last + 1]) {
				break;
			}
			last--;
		}
		if (last < 0)
			return false;

		int nextGreater = data.length - 1;
		for (int i = data.length - 1; i > last; i--) {
			if (data[i] > data[last]) {
				nextGreater = i;
				break;
			}
		}
		data = swap(data, nextGreater, last);
		data = reverse(data, last + 1, data.length - 1);
		return true;
	}

	static long nCr(long n, long r) {
		if (n == r)
			return 1;
		return fact(n) / (fact(r) * fact(n - r));
	}

	static long fact(long n) {
		long res = 1;
		for (long i = 2; i <= n; i++)
			res = res * i;
		return res;
	}

	/*
	 * static boolean prime[] = new boolean[1000007];
	 *
	 * public static void sieveOfEratosthenes(int n) {
	 *
	 * for (int i = 0; i < n; i++) prime[i] = true; * for (int p = 2; p * p <=
	 * n; p++) { // If prime[p] is not changed, then it is a prime if (prime[p]
	 * == true) { // Update all multiples of p for (int i = p * p; i <= n; i +=
	 * p) prime[i] = false; } }
	 *
	 * // Print all prime numbers // for(int i = 2; i <= n; i++) // { //
	 * if(prime[i] == true) // System.out.print(i + " "); // } }
	 */

	static long power(long fac2, int y, int p) {
		long res = 1;
		fac2 = fac2 % p;
		while (y > 0) {
			if (y % 2 == 1)
				res = (res * fac2) % p;
			fac2 = (fac2 * fac2) % p;
		}
		return res;
	}

	static long modInverse(long fac2, int p) {
		return power(fac2, p - 2, p);
	}

	static boolean isPrime(int n) {
		// Corner cases
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;

		// This is checked so that we can skip
		// middle five numbers in below loop
		if (n % 2 == 0 || n % 3 == 0)
			return false;

		for (int i = 5; i * i <= n; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}

	public static BigInteger lcmm(String a, String b) {
		BigInteger s = new BigInteger(a);
		BigInteger s1 = new BigInteger(b);
		BigInteger mul = s.multiply(s1);
		BigInteger gcd = s.gcd(s1);
		BigInteger lcm = mul.divide(gcd);
		return lcm;
	}

}