#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(n, 0);
    for (int i = 0; i < n; ++i) cin >> v[i];
    int h = 1, dec = 0, i, j;
    for (i = 1; i < n; i = j + 1) {
      for (j = i; j < n; ++j) {
        if (j + 1 < n && v[j + 1] < v[j]) dec--;
        if (dec < 0) {
          h++;
          dec = j - i;
          break;
        }
      }
    }
    cout << h << endl;
  }
  return 0;
}
