#C3487. Longest Even Subarray
Longest Even Subarray
Longest Even Subarray
Given an array of integers, find the length of the longest contiguous subarray such that every element in the subarray is even. In other words, you need to determine the maximum length of a sequence \(a_i, a_{i+1}, \ldots, a_j\) where for every index \(k\), \(a_k \bmod 2 = 0\).
If no even numbers exist in the array, output 0.
inputFormat
The input consists of two lines. The first line contains a single integer \(n\) representing the number of elements in the array. The second line contains \(n\) space-separated integers representing the array elements.
outputFormat
Output a single integer representing the length of the longest contiguous subarray composed entirely of even numbers.
## sample1
2
1