The sequence of m integers is called the permutation if it contains all integers from 1 to m exactly once. The number m is called the length of the permutation.

Dreamoon has two permutations p_1 and p_2 of non-zero lengths l_1 and l_2.

Now Dreamoon concatenates these two permutations into another sequence a of length l_1 + l_2. First l_1 elements of a is the permutation p_1 and next l_2 elements of a is the permutation p_2. 

You are given the sequence a, and you need to find two permutations p_1 and p_2. If there are several possible ways to restore them, you should find all of them. (Note that it is also possible that there will be no ways.)

Input

The first line contains an integer t (1 ≤ t ≤ 10 000) denoting the number of test cases in the input.

Each test case contains two lines. The first line contains one integer n (2 ≤ n ≤ 200 000): the length of a. The second line contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ n-1).

The total sum of n is less than 200 000.

Output

For each test case, the first line of output should contain one integer k: the number of ways to divide a into permutations p_1 and p_2.

Each of the next k lines should contain two integers l_1 and l_2 (1 ≤ l_1, l_2 ≤ n, l_1 + l_2 = n), denoting, that it is possible to divide a into two permutations of length l_1 and l_2 (p_1 is the first l_1 elements of a, and p_2 is the last l_2 elements of a). You can print solutions in any order.

Example

Input


6
5
1 4 3 2 1
6
2 4 1 3 2 1
4
2 1 1 3
4
1 3 3 1
12
2 1 3 4 5 6 7 8 9 1 10 2
3
1 1 1


Output


2
1 4
4 1
1
4 2
0
0
1
2 10
0

Note

In the first example, two possible ways to divide a into permutations are \{1\} + \{4, 3, 2, 1\} and \{1,4,3,2\} + \{1\}.

In the second example, the only way to divide a into permutations is \{2,4,1,3\} + \{2,1\}.

In the third example, there are no possible ways.
import java.io.*;
import java.util.*;

public class Task2 {
    FastScanner scanner;
    PrintWriter writer;

    public final String INPUT_FILE_NAME = "input.txt";
    public final String OUTPUT_FILE_NAME = "output.txt";

    public void run() {
        try {
            writer = new PrintWriter(System.out);//new PrintWriter(new File(OUTPUT_FILE_NAME));
            scanner = new FastScanner(System.in);//new FastScanner(new File(INPUT_FILE_NAME));

            solution();

            writer.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {
        BufferedReader reader;

        StringTokenizer tokenizer;
        FastScanner(File file) throws FileNotFoundException {
            reader = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
        }

        FastScanner(InputStream is) {
            reader = new BufferedReader(new InputStreamReader(is));
        }

        boolean hasNext() {
            boolean result = false;
            if (tokenizer != null && tokenizer.hasMoreTokens()) {
                result =  true;
            } else {
                String newLine = null;
                try {
                    newLine = reader.readLine();
                    while(newLine != null) {
                        newLine = newLine.trim();
                        if (!newLine.equals("")) {
                            break;
                        }
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                }

                if (newLine != null) {
                    result = true;
                    tokenizer = new StringTokenizer(newLine);
                }
            }

            return result;
        }

        String next() {
            hasNext();
            return tokenizer.nextToken();
        }

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

    }

    public static void main(String[] args) {
        new Task2().run();
    }

    public StreamTokenizer st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));

    public int nextInt() throws IOException {
        st.nextToken();
        return (int)st.nval;
    }

    public int[] nextArray(int n) throws IOException {
        int[] result = new int[n];
        for (int index = 0; index < n; ++index) {
            result[index] = nextInt();
        }
        return result;
    }

    public final static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

    public void solution() throws IOException {
        int t = nextInt();
        for (int index = 0; index < t; ++index) {
            int n = nextInt();
            int[] array = nextArray(n);
            solution(n, array);
        }
    }

    public void solution(int n, int[] array) {
        List<Integer[]> result = new ArrayList<>();

        boolean[] beginGood = new boolean[n];
        boolean[] endGood = new boolean[n];

        for (int i = 0; i < n; ++i) {
            beginGood[i] = false;
            endGood[i] = false;
        }

        Set<Integer> set = new HashSet<>();
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < n-1; ++i) {
            int x = array[i];
            if (set.contains(x)) {
                break;
            }
            set.add(x);
            max = Math.max(max, x);
            if (max == (i+1)) {
                beginGood[i] = true;
            }
        }

        set.clear();
        max = Integer.MIN_VALUE;
        for (int i = n-1; i > 0; --i) {
            int x = array[i];
            if (set.contains(x)) {
                break;
            }
            set.add(x);
            max = Math.max(max, x);
            if (max == (n-i)) {
                endGood[i] = true;
            }
        }

        for (int i = 0; i < n - 1; ++i) {
            if (beginGood[i] && endGood[i + 1]) {
                result.add(new Integer[]{i + 1, n-i-1});
            }
        }

        System.out.println(result.size());
        for (Integer[] pair : result) {
            System.out.println(pair[0] + " " +  pair[1]);
        }
    }
}
