#K4441. Subarray Parity Queries

    ID: 27525 Type: Default 1000ms 256MiB

Subarray Parity Queries

Subarray Parity Queries

Given an array of n integers and q queries, you are to determine whether the sum of the elements in each queried subarray is odd or even.

For each query consisting of two indices l and r (1-indexed), the task is to compute the sum \[ S = \sum_{i=l}^{r} a_i \] and then determine if S is odd or even.

It is recommended to use prefix sums for efficient range sum queries.

inputFormat

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

  • The first line contains two integers, n and q, where n is the number of elements in the array and q is the number of queries.
  • The second line contains n space-separated integers representing the array.
  • The following q lines each contain two space-separated integers l and r representing the start and end indices of a query (1-indexed).

outputFormat

For each query, output a single line containing either Odd or Even depending on whether the sum of the subarray is odd or even.

The output should be written to standard output (stdout).

## sample
5 3
1 2 3 4 5
1 3
2 4
1 5
Even

Odd Odd

</p>