#C6484. Longest Contiguous Even Subsequence

    ID: 50249 Type: Default 1000ms 256MiB

Longest Contiguous Even Subsequence

Longest Contiguous Even Subsequence

You are given t test cases. For each test case, you are provided with an array of n integers. Your task is to determine the length of the longest contiguous subsequence (segment) that consists entirely of even numbers.

Formally, for an array \(A\) of length \(n\), you need to find the maximum \(k\) such that there exists an index \(i\) with \(1 \le i \le n-k+1\) and \(A[i], A[i+1], \dots, A[i+k-1]\) are all even, i.e., each \(A[j] \) satisfies \(A[j] \bmod 2 = 0\). If no even number exists, the answer is 0.

The answer for each test case should be printed on a separate line.

inputFormat

The first line of input contains a single integer t (\(1 \le t \le 100\)), the number of test cases.

For each test case, the first line contains a single integer n (\(1 \le n \le 10^5\)), representing the number of elements in the array. The second line contains n space-separated integers \(A_1, A_2, \dots, A_n\), where each \(A_i\) satisfies \(|A_i| \le 10^9\).

Input is given via standard input (stdin).

outputFormat

For each test case, output a single integer on a new line, the length of the longest contiguous subsequence of even numbers.

Output should be written to standard output (stdout).

## sample
1
6
1 2 4 6 5 7
3

</p>