import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;

void main ()
{
	auto tests = readln.strip.to !(int);
	foreach (test; 0..tests)
	{
		auto n = readln.strip.to !(int);
		auto a = readln.splitter.map !(to !(int)).array;
		int [] levels;
		levels ~= 1;
		int cur = 0;
		int prev = 1;
		foreach (i; 2..n)
		{
			if (a[i] < a[i - 1])
			{
				cur -= 1;
				if (cur < 0)
				{
					levels ~= i - prev;
					prev = i;
					cur = levels.back - 1;
				}
			}
		}
		writeln (levels.length);
	}
}
