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>

//package cf;
import com.sun.security.jgss.GSSUtil;
import org.w3c.dom.html.HTMLBRElement;

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

public class T_class {
    static int p=1000000007;
    static int max=(int)1e5;
    static  int my_val=0;
    static boolean prime[]=new boolean[max+5];
    static  double dp[][]=new double[(int)1e5+2][100];
    static  List<Integer> total_prime=new ArrayList<>();

   public static void main(String[] args) throws Exception {
   BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(java.io.FileDescriptor.out), "ASCII"), 512);
        FastReader sc=new FastReader();
        int t=sc.nextInt();
        StringBuilder sb2=new StringBuilder();
        //
        // 12654
       //seive();

       while(t-- >0) {
            int n=sc.nextInt();
            int ar[]=new int[n];
           List<Integer> adj[]=new ArrayList[n+1];
           for(int i=0;i<n;i++)
            {
                adj[i]=new ArrayList<>();
                if(i==n)
                {
                    continue;
                }
                ar[i]=sc.nextInt();
            }
            int prev=-1;
            int count=1;
            int level[]=new int[n+1];
Arrays.fill(level,0);
level[0]=1;
            for(int i=1;i<n;i++)
            {
                level[count]+=1;
                while(i+1<n&&ar[i]<ar[i+1])
                {
                    i++;
                    level[count]++;
               //     System.out.println(count+" in "+Arrays.toString(level));
                }
             //   System.out.println(count+" "+Arrays.toString(level));
                level[count-1]--;
                if(level[count-1]==0) {
                    count++;
                }
                }
       /*
4 2
0.50 0.50 0.50 0.50
4.00 1.00 2.00 3.00
4.00 0.50 1.00 1.00
        */
           sb2.append((level[count]!=0?count:count-1)+"\n");
       }
       System.out.println(sb2.toString());
        out.flush();
    }
    public static double ans(double p[],double x[],double y[],int m,int i,int n)
    {
        if(i>=n||m==0)
        {
            return 0.0;
        }
        if(dp[i][m]!=-1)
            return dp[i][m];
        double cur_ans=Math.max((p[i]*x[i]-(1-p[i])*y[i])+ans(p,x,y,m-1,i+1,n),ans(p,x,y,m,i+1,n));
        return dp[i][m]=cur_ans;
    }

    private static long ncr(int n, int r, long[] fact) {
       if(r>n||n < 0 || r < 0)
           return 0;

       if(n==1||n==0)
           return 1;
       // System.out.println(n+" c "+r);

       return (((fact[n]*pow_inverse(fact[n-r],p))%p)*pow_inverse(fact[r],p))%p;
    }

    public static List<Integer> binary(int[] ar, int l, int r, long v)
    {
        List<Integer> mid_ind=new ArrayList<>();
        int n=r;
        int m=(l+r)/2;
        int re=-1;
        while(l<r)
        {
         //   System.out.println(l+" "+r+" "+m);
            mid_ind.add(m);
            if(ar[m]<=v)
            {

                l=m+1;
            }
            else {
                r=m;
            }
            m=(l+r)/2;
        }
        if(l>0&&ar[l-1]==v)
        {
            my_val=l-1;
            return mid_ind;
        }
        return mid_ind;
    }
    static  int ht[]=new int[max];
    static class BIT {
        long[] tree;
        public BIT(int size) {
            tree = new long[size + 1];
        }
        public long sum(int i) {
            long ans = 0;
            while (i > 0) {
                ans += tree[i];
                i -= i & -i;
            }
            return ans;
        }

        public long query(int i, int j) {
            return sum(j) - sum(i - 1);
        }

        public void add(int i, long val) {
            while (i < tree.length) {
                tree[i] += val;
                i += i & -i;
            }
        }

        public void set(int i, long val) {
            add(i, val - query(i, i));
        }
    }
    static class  vert implements Comparator<vert>
    {
        int v;
        TreeSet<Integer> set;

        public vert(int v, TreeSet<Integer> set) {
            this.v = v;
            this.set = set;
        }

        @Override
        public int compare(vert o1, vert o2) {
            return -(o1.set.size()-o2.set.size());
        }
    }
    public static long pow(long a,long b,long m)
    {
        long r=1;
        while(b!=1)
        {
            if(b%2!=0)
                r=(r*a)%m;
            b=b>>1;
            a=(a*a)%m;
        }
        return (r*a)%m;
    }
    public static long pow_inverse(long a,long m)
    {
        return pow(a,m-2,m);
    }public static long gcd(long a,long b)
    {
        if(b>a)
        {
            a=a^b;
            b=a^b;
            a=a^b;
        }
        if(b==0)
            return a;
        return gcd(b,a%b);
    }
    public static void extgcd(long a,long b)
    {/*
            if(a==0)
            {
                x=0;
                y=1;
                d=b;
                // return ;
            }
            else
            {

                extgcd(b%a,a);

                long t=y;
                y=x;
                x=t-(b/a)*x;
            }*/
    }
    public static void dfs(List<Integer> adj[],int u,int p)
    {
        ht[u]=ht[p]==1?2:1;
        for(int v:adj[u])
        {
            if(v!=p)
            {
                dfs(adj,v,u);
            }
        }
    }
    public static void seive()
    {
        for(int i=0;i<max;i++)
            prime[i] = true;

        for(int p = 2; p*p <=max; 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 <=max; i += p)
                    prime[i] = false;
            }
        }

        // Print all prime numbers
        for(int i = 2; i <= max; i++)
        {
            if(prime[i] == true)
            {
                total_prime.add(i);
            }
        }
    }
    public static boolean union(int a, int b, int p[], int r[]){
        // add your code here
        int pa=find(a,p,r);
        int pb=find(b,p,r);
        if(pa==pb)
            return true;
        if(pa!=pb)
        {
            if(r[pa]<r[pb])
            {
                p[pa]=pb;
            }
            else if(r[pa]>r[pb])
            {
                p[pb]=pa;
            }
            else
            {
                p[pa]=pb;
                r[pb]++;
            }
        }
        return false;
    }
    public static int find(int x,int p[],int r[])
    {
        if(p[x]==x)
            return x;
        p[x]=find(p[x],p,r);
        return p[x];
    }
    public static int binary_Search_upper(Integer[] ar, Integer x)
    {
        int res=-1;
        int l=0;int r=ar.length-1;
        while(l<=r)
        {
            int mid=(l+r)>>1;
            if(ar[mid]==x)
            {
                res=mid;
                l=mid+1;
            }
            else if(ar[mid]>x)
            {
                //res=mid;
                r=mid-1;
            }
            else
            {
                l=mid+1;
            }
        }
        return res;
    }
    public static int binary_Search_lower(Long[] ar, long x, int l, int r)
    {
        int res=-1,f=0;
        //int l=0;int r=ar.length-1;
        /*public static int binary(Long[] ar, int l, int r, long v)
        {
            int n=r;
            int m=(l+r)/2;
            int re=-1;
            while(l<=r)
            {
                if(ar[m]>=v)
                {

                    re=m;
                    r=m-1;
                }
                else if(ar[m]<v)
                {
                    l=m+1;
                }
                m=(l+r)/2;
            }
            if(l<=n&&ar[l]==v)
                return l;
            return re;
        }*/
        while(l<=r)
        {
            int mid=(l+r)>>1;
          //  System.out.println(l+" "+r+" "+mid+" = "+ar[mid]);
            if(ar[mid]==x)
            {
                f=1;
                res=mid;
                r=mid-1;
            }
            else if(ar[mid]>x)
            {
                r=mid-1;
            }
            else
            {
                res=res!=-1&&ar[res]==x?res:mid;
                l=mid+1;
            }
        }

        //System.out.println(res);
        return f==1?res:res+1;
    } public static int binary_Search_lower_suf(int[] ar, int x,int l,int r)
    {
        int res=-1,f=0;
        //int l=0;int r=ar.length-1;
        while(l<=r)
        {
            int mid=(l+r)>>1;
            if(ar[mid]==x)
            {
             f=1;
                res=mid;
                r=mid-1;
            }
            else if(ar[mid]<x)
            {
                r=mid-1;
            }
            else
            {
                //      res=mid;
                l=mid+1;
            }
        }
        return f==0?res+1:res;
    }
    int bit[]=new int[(int)1e6];
    public void update(int n,int val,int i)
    {
        i++;
        while(i<n)
        {
            bit[i]+=val;
            i+=(i)&(-i);
        }

    }
    public long query(int n,int i)
    {
        i++;
        long sum=0;
        while(i>0)
        {
            sum+=bit[i];
            i-=(i)&(-i);
        }
        return sum;
    }


    ///////////////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////////////////////////
    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;
        }
    }


}
