#C14428. Longest Even Contiguous Subsequence

    ID: 44076 Type: Default 1000ms 256MiB

Longest Even Contiguous Subsequence

Longest Even Contiguous Subsequence

Given an array of integers, your task is to find the length of the longest contiguous subsequence in which every element is even. Formally, given an array \(A\) of length \(N\), you need to determine the maximum length \(L\) such that for some index \(i\) (\(1 \le i \le N-L+1\)), the subarray \(A[i], A[i+1], \dots, A[i+L-1]\) contains only even numbers. An integer \(x\) is even if \(x \mod 2 = 0\). This problem tests your ability to iterate over arrays and maintain counters efficiently.

inputFormat

The input is read from the standard input (stdin) and is in the following format:

  1. The first line contains a single integer \(N\) (\(1 \le N \le 10^5\)), representing the number of elements in the array.
  2. The second line contains \(N\) space-separated integers \(A[1], A[2], \dots, A[N]\), representing the elements of the array.

outputFormat

Output to the standard output (stdout) a single integer representing the length of the longest contiguous subsequence of even integers.

## sample
11
1 2 4 6 8 10 3 5 7 8 12
5