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.util.*;

public class Main {
	public static void main(String[] args) throws Exception {
		int t = 1;
		t = ni();
		for (int _t = 1; _t <= t; _t++) {
			int n = ni();
			int a[] = nia(n);
			int h[] = new int[n];
			int p = 0, i = 1, prev = imin;
			while (i < n) {
				while (i < n && a[i] > prev) {
					h[i] = h[p] + 1;
					prev = a[i];
					i++;
				}
				prev = imin;
				p++;
			}
			pln(max(h));
		}
		flush();
	}

	static Reader in = new Reader();
	static StringBuilder output = new StringBuilder();
	static final int imod = 1000_000_007;
	static final long mod = 1000_000_007;
	static final int imax = 1000_000_000;
	static final int imin = -1000_000_000;
	static final long lmax = 1000_000_000_000_000_000L;
	static final long lmin = -1000_000_000_000_000_000L;

	//input functions
	static int ni() {return Integer.parseInt(in.next());}
	static long nl() {return Long.parseLong(in.next());}
	static String ns() {return in.next();}
	static double nd() {return Double.parseDouble(in.next());}
	static int[] eia(int n) {int a[] = new int[n]; return a;}
	static long[] ela(int n) {long a[] = new long[n]; return a;}
	static double[] eda(int n) {double a[] = new double[n]; return a;}
	static String[] esa(int n) {String a[] = new String[n]; return a;}
	static int[] nia(int n) {int a[] = new int[n]; for (int i = 0; i < n; i++)a[i] = ni(); return a;}
	static long[] nla(int n) {long a[] = new long[n]; for (int i = 0; i < n; i++)a[i] = nl(); return a;}
	static String[] nsa(int n) {String a[] = new String[n]; for (int i = 0; i < n; i++)a[i] = ns(); return a;}
	static double[] nda(int n) {double a[] = new double[n]; for (int i = 0; i < n; i++)a[i] = nd(); return a;}

	//output functions
	static void print(String a[]) {for (String i : a) System.out.print(i + " "); System.out.println();}
	static void print(int a[]) {for (int i : a) System.out.print(i + " "); System.out.println();}
	static void print(long a[]) {for (long i : a) System.out.print(i + " "); System.out.println();}
	static void print(double a[]) {for (double i : a) System.out.print(i + " "); System.out.println();}
	static void print(Object... a) {for (Object i : a) {System.out.print(i); System.out.print(" ");} System.out.println();}
	static void println(Object... a) {for (Object i : a) {System.out.print(i); System.out.print("\n");}}
	static void println() {System.out.println();}
	static void flush() {System.out.print(output); output = new StringBuilder();}
	static void pln(int []a) {for (int i : a) {output.append(i).append('\n');}}
	static void pln(long []a) {for (long i : a) {output.append(i).append('\n');}}
	static void pln(double []a) {for (double i : a) {output.append(i).append('\n');}}
	static void pln(String []a) {for (String i : a) {output.append(i).append('\n');}}
	static void pln(Object...a) {for (Object i : a) {output.append(i).append('\n');}}
	static void pln() {output.append('\n');}
	static void p(int []a) {for (int i : a) {output.append(i);}}
	static void p(long []a) {for (long i : a) {output.append(i);}}
	static void p(double []a) {for (double i : a) {output.append(i);}}
	static void p(String []a) {for (String i : a) {output.append(i);}}
	static void p(Object[] a) {for (Object i : a) {output.append(i);}}
	static void ps() {output.append(" ");}
	static void ps(int []a) {for (int i : a) {output.append(i).append(" ");}}
	static void ps(long []a) {for (long i : a) {output.append(i).append(" ");}}
	static void ps(double []a) {for (double i : a) {output.append(i).append(" ");}}
	static void ps(String []a) {for (String i : a) {output.append(i).append(" ");}}
	static void ps(Object... a) {for (Object i : a) {output.append(i).append(" ");}}



	//Utility functions
	static int lowerbound(int[]a, int key) { // returns index of smallest element larger than equal to given element between indices l and r inclusive
		int low = 0, high = a.length - 1, mid = (low + high) / 2; while (low < high) {if (a[mid] >= key)high = mid; else low = mid + 1; mid = (low + high) / 2;} return mid;
	}
	static int upperbound(int[]a, int key) {int low = 0, high = a.length - 1, mid = (low + high + 1) / 2; while (low < high) {if (a[mid] <= key) low = mid; else high = mid - 1; mid = (low + high + 1) / 2;} return mid;}
	static int lowerbound(int[]a, int l, int r, int key) { int low = l, high = r, mid = (low + high) / 2; while (low < high) { if (a[mid] >= key) high = mid; else low = mid + 1; mid = (low + high) / 2;} return mid;}
	static int upperbound(int[]a, int l, int r, int key) { // returns index of largest element smaller than equal to given element
		int low = l, high = r, mid = (low + high + 1) / 2; while (low < high) { if (a[mid] <= key) low = mid; else high = mid - 1; mid = (low + high + 1) / 2;} return mid;
	}

	static long powm(long a, long b, long mod) {long an = 1; long c = a % mod; while (b > 0) {if (b % 2 == 1)an = (an * c) % mod; c = (c * c) % mod; b >>= 1;} return an;}
	static long powm(long a, long b) {long an = 1; long c = a % mod; while (b > 0) {if (b % 2 == 1)an = (an * c) % mod; c = (c * c) % mod; b >>= 1;} return an;}
	static long pow(long a, long b) {long an = 1; long c = a; while (b > 0) {if (b % 2 == 1)an *= c; c *= c; b >>= 1;} return an;}
	static void reverse(int[]a) {for (int i = 0; i < a.length / 2; i++) {a[i] ^= a[a.length - i - 1]; a[a.length - i - 1] ^= a[i]; a[i] ^= a[a.length - i - 1];}}
	static void exit() {System.exit(0);}
	static int min(int... a) {int min = a[0]; for (int i : a)min = Math.min(min, i); return min;}
	static long min(long... a) {long min = a[0]; for (long i : a)min = Math.min(min, i); return min;}
	static double min(double... a) {double min = a[0]; for (double i : a)min = Math.min(min, i); return min;}
	static double max(double... a) {double max = a[0]; for (double i : a)max = Math.max(max, i); return max;}
	static int max(int... a) {int max = a[0]; for (int i : a)max = Math.max(max, i); return max;}
	static long max(long... a) {long max = a[0]; for (long i : a)max = Math.max(max, i); return max;}
	static long gcd(long... a) {long gcd = a[0]; for (long i : a)gcd = gcd(gcd, i); return gcd;}
	static int gcd(int... a) {int gcd = a[0]; for (int i : a)gcd = gcd(gcd, i); return gcd;}
	static int gcd(int a, int b) {if (b == 0)return a; if (a == 0) return b; return gcd(b, a % b);}
	static long gcd(long a, long b) {if (b == 0)return a; if (a == 0) return b; return gcd(b, a % b);}

	static class Pair {
		long la, lb;
		int a, b;
		double da, db;
		Pair() {} Pair(int c, int d) {a = c; b = d;}
		Pair(long c, long d) {la = c; lb = d;}
		Pair(int c, long d) { a = c; lb = d; }
		Pair(long c, int d) { la = c; b = d; }
		Pair(int c, double d) { a = c; db = d; }
		Pair(double c, double d) { da = c; db = d; }
		Pair(double c, int d) { da = c; b = d; }

		@Override
		public int hashCode() { return (a + " " + b).hashCode(); }
		public boolean equals(Object c) { return (a == (((Pair)c).a) && b == (((Pair)c).b)); }
	}

	static class Reader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public Reader() {
			reader = new BufferedReader(new InputStreamReader(System.in));
			tokenizer = null;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
	}
}
class AL<T> extends java.util.ArrayList<T> {}
class HM<T, L> extends java.util.HashMap<T, L> {}
class HS<T> extends java.util.HashSet<T> {}

