Hill Climb

Time limit: 0.8s Memory limit: 256MB Input: Output:

You are given an array aa of nn integers and you want to make it non-increasing.

In order to accomplish your goal, you have to use the following operation:
During one run from position 11 to nn, you will do the following thing for each position ii (1in11 \leq i \leq n-1), in increasing order: if aiai+1a_i \leq a_{i+1}, you will make aia_i equal to ai+1a_{i+1}.

As an example, if one were to traverse {4,1,5,3,3}\{4, 1, 5, 3, 3\}, they will start at i=1i = 1, go to i=2i = 2, raise a2a_2 to 55, go to i=3i = 3 then to i=4i = 4. After the modifications the array will have these values: {4,5,5,3,3}\{4, 5, 5, 3, 3\}.

You must answer how many runs you need to make until the array becomes non-increasing.

Input

Each test contains multiple test cases. The first line contains the number of test cases tt (1t101 \leq t \leq 10).

Description of the test cases follows.

The first line of each test case contains one integer nn (2n1052 \leq n \leq 10^5).
For tests worth 20%20\% of the points, 1n1031 \leq n \leq 10^3.

The second line of each test case contains nn integers a1a_1, a2a_2, ..., ana_n (109ai109-10^9 \leq a_i \leq 10^9).

Output

For each test case, you must answer how many runs you need to make until the array becomes non-increasing.

Example

stdin

2
5
4 1 5 3 3
4
5 5 4 2

stdout

2
0

Explanation

The first test case requires two iterations and they look like this:
{4,1,5,3,3}{4,5,5,3,3}{5,5,5,3,3}\{4, 1, 5, 3, 3\} \rightarrow \{4, 5, 5, 3, 3\} \rightarrow \{5, 5, 5, 3, 3\}.

In the second test case the array is already non-increasing so the answer is 00.

Log in or sign up to be able to send submissions!