Monocarp had a tree which consisted of n vertices and was rooted at vertex 1. He decided to study BFS ([Breadth-first search](https://en.wikipedia.org/wiki/Breadth-first_search)), so he ran BFS on his tree, starting from the root. BFS can be described by the following pseudocode:
    
    
    a = [] # the order in which vertices were processed  
    q = Queue()  
    q.put(1) # place the root at the end of the queue  
    while not q.empty():  
        k = q.pop() # retrieve the first vertex from the queue  
        a.append(k) # append k to the end of the sequence in which vertices were visited  
        for y in g[k]: # g[k] is the list of all children of vertex k, sorted in ascending order  
            q.put(y)  
    

Monocarp was fascinated by BFS so much that, in the end, he lost his tree. Fortunately, he still has a sequence of vertices, in which order vertices were visited by the BFS algorithm (the array a from the pseudocode). Monocarp knows that each vertex was visited exactly once (since they were put and taken from the queue exactly once). Also, he knows that all children of each vertex were viewed in ascending order.

Monocarp knows that there are many trees (in the general case) with the same visiting order a, so he doesn't hope to restore his tree. Monocarp is okay with any tree that has minimum height.

The height of a tree is the maximum depth of the tree's vertices, and the depth of a vertex is the number of edges in the path from the root to it. For example, the depth of vertex 1 is 0, since it's the root, and the depth of all root's children are 1.

Help Monocarp to find any tree with given visiting order a and minimum height.

Input

The first line contains a single integer t (1 ≤ t ≤ 1000) — the number of test cases.

The first line of each test case contains a single integer n (2 ≤ n ≤ 2 ⋅ 10^5) — the number of vertices in the tree.

The second line of each test case contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ n; a_i ≠ a_j; a_1 = 1) — the order in which the vertices were visited by the BFS algorithm.

It's guaranteed that the total sum of n over test cases doesn't exceed 2 ⋅ 10^5.

Output

For each test case print the minimum possible height of a tree with the given visiting order a.

Example

Input


3
4
1 4 3 2
2
1 2
3
1 2 3


Output


3
1
1

Note

In the first test case, there is only one tree with the given visiting order: 

<image>

In the second test case, there is only one tree with the given visiting order as well: 

<image>

In the third test case, an optimal tree with the given visiting order is shown below: 

<image>
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.*;

public class Main {



    static class Task {

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int q = in.nextInt();
            for(int i=0;i<q;++i){
                int n = in.nextInt();
                int a[] = in.nextArray(n);
                int lst = -1;int ht  = 1;
                int pt  = 1;
                int nxt =  0;
                for(int j=1;j<n;++j){
                    int v =  a[j];
                    if(v>lst){
                        lst  = v;
                        nxt++;
                    }else{
                        pt--;
                        if(pt==0) {
                            pt  = nxt;
                            ht++;
                            lst = v;
                            nxt = 1;
                        }else{
                            lst = v;nxt++;
                        }
                    }
                }
                out.println(ht);

            }
        }

        public double[][] gauss(double a[][]){
            int n = a.length;
            int m = n+1;

            for(int j=0;j<n;++j){
                int idx = j; double ck = a[idx][j];
                for(int i=j+1;i<n;++i){
                    if( Math.abs(a[i][j]) > ck ){
                        ck = Math.abs(a[i][j]);
                        idx = i;
                    }
                }
                if(idx!=j) {
                    double cg[] = a[j];
                    a[j] = a[idx];
                    a[idx] = cg;
                }

                for(int i=0;i<n;++i){
                    if(i==j) continue;
                    double rate = a[i][j] / a[j][j];
                    for(int k=j;k<m;++k){
                        a[i][k] -= rate * a[j][k];
                    }
                }


            }
            return a;

        }

        public int num(int i,int j){
            return i*m + j;
        }
        String cs[];
        String ops[];
        public void solve22(int testNumber, InputReader in, PrintWriter out) {
            n  = in.nextInt();
            m  = in.nextInt();
            int  t  = in.nextInt();
            int  act = in.nextInt();
            cs = new String[n];
            for(int i=0;i<n;++i){
                cs[i] = in.next();
            }
            ops = new String[act];
            for(int i=0;i<act;++i){
                ops[i] = in.next();
            }

            long v[][] = new long[1][n*m+1];
            v[0][n*m] = 1;

            int q =  t/60;
            int r =  t%60;

            long ju1[][] = go(60);
            long ju2[][] = go(r);

            long res[][] = quick(ju1,q);

            res = mult(res,ju2);

            res = mult(v,res);

            long big = 0;
            for(int i=0;i<=n*m;++i){
                big = Math.max(big, res[0][i]);
            }
            out.println(big);


        }

        long[][] mult(long a[][],long b[][]){
            int l1 = a.length;
            int l2 = b.length;
            int l3 = b[0].length;
            long r[][] = new long[l1][l3];
            for(int i=0;i<l1;++i){
                for(int j=0;j<l2;++j){
                    for(int k=0;k<l3;++k){
                        r[i][k] = r[i][k] + a[i][j] * b[j][k];
                    }
                }
            }
            return r;
        }

        long[][] add(long a[][],long b[][],long mod){
            int l1 = a.length;
            int l2 = a[0].length;

            long r[][] = new long[l1][l2];
            for(int i=0;i<l1;++i){
                for(int j=0;j<l2;++j){
                    r[i][j] = (a[i][j] + b[i][j])%mod;
                }
            }
            return r;

        }

        long[][] ones(int len){
            long r[][] = new long[len][len];
            for(int i=0;i<len;++i){
                r[i][i] = 1L;
            }
            return r;
        }

        long[][] quick(long a[][], int times){
            int len = a.length;
            long ans[][] = ones(len);

            while(times>0){
                if((times&1)==1) {
                    ans = mult(ans, a);
                }
                a = mult(a, a);
                times >>= 1;
            }

            return ans;
        }

        public long[][] go(int tm){
            int len = n*m+1;
            long t[][] = new long[len][len];

            for(int i=0;i<len;++i){
                t[i][i] = 1;
            }

            for(int c=0;c<tm;++c){
                long dt[][] = new long[len][len];
                dt[len-1][len-1] = 1;
                for(int i=0;i<n;++i){
                    for(int j=0;j<m;++j){
                        int op = cs[i].charAt(j) - '0';
                        String cur = ops[op];
                        int l = cur.length();
                        int idx = c%l;
                        char p = cur.charAt(idx);

                        if(p=='D'){

                        }else if(p=='N'){
                            if(i>0) {
                                dt[num(i, j)][num(i - 1, j)] = 1;
                            }
                        }else if(p=='S'){
                            if(i+1<n) {
                                dt[num(i, j)][num(i + 1, j)] = 1;
                            }
                        }else if(p=='W'){
                            if(j-1>=0) {
                                dt[num(i, j)][num(i , j - 1)] = 1;
                            }
                        }else if(p=='E'){
                            if(j+1<m) {
                                dt[num(i, j)][num(i , j + 1)] = 1;
                            }
                        }else{
                            dt[num(i , j )][num(i , j )] = 1;
                            dt[len-1][num(i , j )] = p-'0';
                        }

                    }
                }
                t = mult(t, dt);
            }

            return t;

        }



        boolean ck(int x,int y){
            return x >= 0 && x < n && y >=0 && y< m && mp[x][y]=='.';
        }

        int dx[] = {1,-1,0,0};
        int dy[] = {0,0,1,-1};

        int bfs2(int fx,int fy, int tx,int ty,int x1,int y1){
            Queue<int[]> q = new ArrayDeque<>();
            q.offer(new int[]{fx,fy});
            int dp[][] = new int[n][m];

            for(int i=0;i<n;++i){
                Arrays.fill(dp,100000000);
            }

            dp[fx][fy] = 0;
            while(q.size()>0){
                int c[] = q.poll();
                for(int j=0;j<4;++j){
                    int nx = c[0] + dx[j];
                    int ny = c[1] + dy[j];
                    if(ck(nx,ny) && !(nx==x1&&ny==y1)){

                    }
                }
            }
            return -1;

        }

        List<Integer> steps = new ArrayList<>();
        int bfs1(){

            for(int j=0;j<4;++j){
                int rx = bx + dx[j];
                int ry = by + dy[j];

                int tuix = bx - dx[j];
                int tuiy = by - dy[j];

                if(ck(rx,ry) && ck(tuix,tuiy)){

                    steps.clear();



                }


            }





            Queue<int[]> q  =new ArrayDeque<>();
            q.offer(null);

            return -1;
        }

        int mx,my,bx,by,tx,ty,n,m;
        char mp[][];
        public void solve1(int testNumber, InputReader in, PrintWriter out) {
            int t = 1;
            while(true){
                n = in.nextInt();
                m = in.nextInt();
                if(n==0&&m==0) break;
                out.println("Maze #"+ t);
                mp = new char[n][m];
                for(int i=0;i<n;++i){
                    mp[i] = in.next().toCharArray();
                    for(int j=0;j<m;++j){
                        if(mp[i][j]=='S'){
                            mx = i;my = j; mp[i][j] = '.';
                        }else if(mp[i][j]=='B'){
                            bx = i;by = j; mp[i][j] = '.';
                        }else if(mp[i][j]=='T'){
                            tx =  i;ty = j; mp[i][j] = '.';
                        }
                    }
                }
                out.println(bfs1());






            }





        }
















    }

    public static String roundS(double result, int scale){
        String fmt = String.format("%%.%df", scale);
        return String.format(fmt, result);
//        DecimalFormat df = new DecimalFormat("0.000000");
//        double result = Double.parseDouble(df.format(result));
    }

    private static void sort(double[] arr) {
        Double[] objArr = Arrays.stream(arr).boxed().toArray(Double[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void sort(int[] arr) {
        Integer[] objArr = Arrays.stream(arr).boxed().toArray(Integer[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void sort(long[] arr) {
        Long[] objArr = Arrays.stream(arr).boxed().toArray(Long[]::new);
        Arrays.sort(objArr);
        for (int i = 0; i < arr.length; i++) {
            arr[i] = objArr[i];
        }
    }

    private static void solve() {
        InputStream inputStream = System.in;
        //InputStream inputStream  = new FileInputStream(new File("D:\\chrome_download\\travel1.in"));
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task task = new Task();
        task.solve(1, in, out);
        out.close();
    }

    public static void main(String[] args) {
         new Thread(null, () -> solve(), "1", (1 << 29 ) +200000000).start();
        //solve();
    }

    static class InputReader {

        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String nextLine() {
            String line = null;
            try {
                line = reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

        public char nextChar() {
            return next().charAt(0);
        }

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

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

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


    }
}