#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[n];
    int i;
    for (i = 0; i < n; i++) cin >> arr[i];
    int ans = 1;
    i = 1;
    int tl = 1;
    std::vector<int> v;
    if (i == n - 1) v.push_back(1);
    while (i < n - 1) {
      if (arr[i] < arr[i + 1])
        tl++;
      else {
        v.push_back(tl);
        tl = 1;
      }
      if (i == n - 2) v.push_back(tl);
      i++;
    }
    i = 0;
    int j = 0;
    int s = v.size();
    queue<int> q;
    q.push(v[i]);
    i++;
    while (i < s) {
      int sz = q.size();
      while (i < s && sz--) {
        int c = q.front();
        q.pop();
        while (c-- && i < s) q.push(v[i++]);
      }
      ans++;
    }
    cout << ans << "\n";
  }
  return 0;
}
