#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n, 0);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long minh = 0;
  long long lastl = 1, nextl = 0;
  for (long long i = 1; i < n;) {
    i++;
    nextl++;
    while (i < n && a[i] > a[i - 1]) {
      nextl++;
      i++;
    }
    lastl--;
    if (lastl <= 0 && nextl > 0) {
      minh++;
      lastl = nextl;
      nextl = 0;
    }
  }
  if (nextl > 0) minh++;
  cout << minh << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  for (int i = 1; i <= t; i++) {
    solve();
  }
}
