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>
#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2e6 + 10;
const long long MOD = 998244353;
long long add(long long x, long long y) {
  x += y;
  while (x >= MOD) x -= MOD;
  while (x < 0) x += MOD;
  return x;
}
long long mul(long long x, long long y) { return (x * 1ll * y) % MOD; }
long long binpow(long long x, long long y) {
  long long ans = 1;
  while (y > 0) {
    if (y % 2 == 1) ans = mul(ans, x);
    x = mul(x, x);
    y /= 2;
  }
  return ans;
}
long long divide(long long x, long long y) {
  return mul(x, binpow(y, MOD - 2));
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> v;
  for (long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    v.push_back(a);
  }
  if (n == 1) {
    cout << 0 << endl;
    return;
  }
  long long res = 1;
  long long factor = 1;
  for (long i = 1; i < n - 1; i++) {
    long long sum = 0;
    long long j = i;
    i--;
    bool check = false;
    while (i < n && factor > 0) {
      check = false;
      for (j = i + 1; j < n - 1; j++) {
        if (v[j] < v[j + 1]) {
          sum++;
        } else {
          check = true;
          break;
        }
      }
      sum++;
      factor--;
      i = j;
    }
    factor = sum;
    if (check) res++;
  }
  cout << res << endl;
  return;
}
int32_t main() {
  long long t;
  cin >> t;
  while (t--) {
    solve();
  }
}
