#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const long long oo = INT_MAX;
const long long MOD = 1e9 + 7;
const long long sz = 1e5 + 5;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long tc = 1;
  cin >> tc;
  while (tc--) {
    long long n;
    cin >> n;
    vector<long long> v(n);
    for (auto& el : v) cin >> el;
    vector<vector<long long>> incrSeq;
    long long i = 1;
    v.push_back(1e18);
    while (i < n) {
      vector<long long> x = {v[i]};
      bool flag = 0;
      i++;
      while (i < n && v[i - 1] < v[i]) {
        x.push_back(v[i++]);
      }
      incrSeq.push_back(x);
    }
    long long currSize = 1, ret = 0;
    reverse(incrSeq.begin(), incrSeq.end());
    while (incrSeq.size()) {
      long long x = currSize;
      currSize = 0;
      while (x-- && incrSeq.size()) {
        currSize += incrSeq.back().size();
        incrSeq.pop_back();
      }
      ret++;
    }
    cout << ret << "\n";
  }
}
