#T207. 怪盗基德的滑翔翼

怪盗基德的滑翔翼

Description

Kaitou Kid is a legendary phantom thief, a super burglar who specializes in stealing jewels. What makes him most remarkable is his ability to escape the relentless pursuit of Inspector Nakamuro time and again, largely thanks to the maneuverable glider he always carries with him.

One day, as usual, Kaitou Kid stole a precious diamond, only to have his disguise seen through by the young detective Conan. Worse yet, the power unit of his glider was damaged by a soccer ball kicked by Conan. Left with no choice, Kaitou Kid had to escape using the damaged glider.

Assume there are a total of N buildings in the city, lined up in a row, each with a distinct height.

Initially, Kaitou Kid can start on the rooftop of any building. He can choose a direction to escape but cannot change direction midway (since Inspector Nakamuro is in hot pursuit). Due to the damaged glider, he can only glide downward (i.e., from a taller building to a shorter one).

He hopes to pass over as many different building rooftops as possible to cushion the impact of his descent and reduce the risk of injury. The question is: what is the maximum number of different building rooftops he can glide over (including the starting building)?

Input Format

The first line of input is an integer K (K < 100), representing the number of test cases.
Each test case consists of two lines: the first line is an integer N (N < 100), representing the number of buildings.
The second line contains N distinct integers, each representing the height h (0 < h < 10000) of a building.

Output Format

For each test case, output one line containing an integer, representing the maximum number of buildings Kaitou Kid can glide over.

3
8
300 207 155 299 298 170 158 65
8
65 158 170 298 299 155 207 300
10
2 1 3 4 5 6 7 8 9 10

6
6
9