You are given an integer. Consider the sequence containing the integers in increasing order (each exactly once). Find the maximum length of its contiguous subsequence with an even sum.
For each test case, print a single line containing one integer — the maximum length of a contiguous subsequence with even sum.
Example case 1: The optimal choice is to choose the entire sequence, since the sum of all its elements is, which is even.
Example case 3: One of the optimal choices is to choose the subsequence, which has an even sum.
50000 Bytes Maximum Length Even Subarray solution codechef
CPP14, C, JAVA, PYTH 3.6, CPP17, PYTH, PYP3, CS2, ADA, PYPY, TEXT, PAS fpc, NODEJS, RUBY, PHP, GO, HASK, TCL, PERL, SCALA, LUA, kotlin, BASH, JS, LISP sbcl, rust, PAS gpc, BF, CLOJ, R, D, CAML, FORT, ASM, swift, FS, WSPC, LISP clisp, SQL, SCM guile, PERL6, ERL, CLPS, ICK, NICE, PRLG, ICON, COB, SCM chicken, PIKE, SCM qobi, ST, SQLQ, NEM
You are given an integer NN. Consider the sequence containing the integers 1,2,…,N1,2,…,N in increasing order (each exactly once). Find the maximum length of its contiguous subsequence with an even sum.