#K36267. Longest Even Subarray Length

    ID: 25717 Type: Default 1000ms 256MiB

Longest Even Subarray Length

Longest Even Subarray Length

In this problem, you are given an array of integers (A) of size (N). Your task is to determine the length of the longest contiguous subarray that contains only even numbers. A contiguous subarray is a sequence of consecutive elements from the array.

For example, given the array [1, 2, 4, 6, 7], the longest contiguous subarray of even numbers is [2, 4, 6] which has a length of 3.

The input will consist of multiple test cases. For each test case, you need to output a single integer, which is the length of the longest contiguous subarray containing only even numbers.

inputFormat

The input is given via standard input (stdin). The first line contains a single integer (T) representing the number of test cases. Each test case consists of two lines:
- The first line contains an integer (N), the size of the array.
- The second line contains (N) space-separated integers representing the elements of the array (A).

outputFormat

For each test case, output a single integer on a new line denoting the length of the longest contiguous subarray that consists entirely of even numbers. The result should be printed to standard output (stdout).## sample

5
5
1 2 4 6 7
4
1 3 5 7
6
8 10 12 14 3 6
5
2 4 6 8 10
3
1 1 1
3

0 4 5 0

</p>