------
## 最终结论
```python
def find_minimum_height(t, test_cases):
    results = []
    for _ in range(t):
        n, a = test_cases[_]
        
        # Calculate the minimum height of the tree
        current_depth = 0
        max_depth = 0
        depth_count = 1
        i = 1
        
        while i < n:
            # Count how many nodes are at the current depth
            next_depth_count = 0
            while i < n and depth_count > 0:
                next_depth_count += 1
                depth_count -= 1
                i += 1
            
            # Move to the next level in the tree
            current_depth += 1
            max_depth = max(max_depth, current_depth)
            
            # Update the number of nodes at the next depth level
            depth_count = next_depth_count

        results.append(max_depth)

    return results

# Read input data
t = int(input().strip())
test_cases = []

for _ in range(t):
    n = int(input().strip())
    a = list(map(int, input().strip().split()))
    test_cases.append((n, a))

# Find minimum heights for each test case and print them
results = find_minimum_height(t, test_cases)
for result in results:
    print(result)
```