------
## 最终结论
```python
def find_permutations(t, test_cases):
    results = []
    
    for case in range(t):
        n, a = test_cases[case]
        
        # Initialize two sets to track unique elements
        p1_set = set()
        p2_set = set(range(1, n + 1))
        
        # Track the maximum number in the current permutation
        max_p1 = 0
        
        # Possible splits
        possible_splits = []
        
        # Check for first permutation from left to right
        for i in range(n):
            p1_set.add(a[i])
            max_p1 = max(max_p1, a[i])
            
            # Check if p1 is a valid permutation
            if len(p1_set) == max_p1 and max_p1 == i + 1:
                # Check if the remaining part can be a valid permutation
                remaining_length = n - (i + 1)
                if remaining_length > 0:
                    p2_max = max(a[i+1:])
                    if set(a[i+1:]) == set(range(1, remaining_length + 1)) and p2_max == remaining_length:
                        possible_splits.append((i + 1, remaining_length))
        
        # Check for second permutation from right to left
        p2_set.clear()
        max_p2 = 0

        for i in range(n-1, -1, -1):
            p2_set.add(a[i])
            max_p2 = max(max_p2, a[i])
            
            # Check if p2 is a valid permutation
            if len(p2_set) == max_p2 and max_p2 == n - i:
                # Check if the starting part can be a valid permutation
                starting_length = i
                if starting_length > 0:
                    p1_max = max(a[:i])
                    if set(a[:i]) == set(range(1, starting_length + 1)) and p1_max == starting_length:
                        possible_splits.append((starting_length, n - starting_length))
        
        # Remove duplicate splits
        possible_splits = list(set(possible_splits))
        
        results.append((len(possible_splits), possible_splits))
    
    return results

# Example usage:
t = 6
test_cases = [
    (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 ,10 ,11 ,12]),
    (3,[1 ,2 ,3])
]

results = find_permutations(t,test_cases)
for result in results:
    print(result[0])
    for split in result[1]:
        print(split[0], split[1])
```