#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, v;
  cin >> q;
  while (q--) {
    cin >> v;
    int arr[v], ans = 1;
    int lv = 0, nxt = 0;
    for (int i = 0; i < v; i++) cin >> arr[i];
    for (int j = 2; j < v; j++) {
      if (arr[j - 1] > arr[j]) {
        if (lv == 0) {
          ans++;
          lv = nxt;
          nxt = 0;
        } else {
          lv--;
          nxt++;
        };
      } else
        nxt++;
    }
    cout << ans << "\n";
  }
  return 0;
}
