#include <bits/stdc++.h>
using namespace std;
long long N = 100001;
long long mod = 1e9 + 7;
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long power(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long p, long long q) {
  if (p % q == 0)
    return q;
  else {
    return gcd(q, p % q);
  }
}
bool comp(long long a, long long b) { return (a > b); }
bool comp1(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first > b.first;
}
template <typename T>
istream& operator>>(istream& in, vector<T>& v) {
  for (T& x : v) in >> x;
  return in;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T>& v) {
  for (T& x : v) out << x << " ";
  return out;
}
long long sum1(vector<long long>& v) {
  long long sum = 0;
  for (long long i = 0; i < v.size(); i++) sum += v[i];
  return sum;
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n + 1);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  v[n] = 0;
  long long a = 1;
  vector<long long> b;
  b.push_back(-1);
  long long j = 0;
  long long ans = 0;
  if (n == 2) {
    cout << 1;
    return;
  }
  long long d = 1;
  long long e = 0;
  for (long long i = 2; i < n + 1; i++) {
    if (v[i] > v[i - 1])
      d++;
    else {
      e = e + d;
      d = 1;
      a--;
      if (a == 0) {
        a = e;
        e = 0;
        ans++;
      }
    }
  }
  if (e != 0) ans++;
  cout << ans;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    solve();
    cout << endl;
  }
  return 0;
}
