Sum of Absolutes
You are given an array of integers and you will be asked to answer some queries.
Function Find(int L,int R)
{
int sum = 0;
for ( i = L ; i<= R; i=i+1 )
{
sum = abs(sum + A[i]);
}
return sum
}
Now Each Query will ask whether the value returned by the function Find is Even or Odd.
Note: is if otherwise .
Input Format
First Line of Input contains and separated by space.
Next Line contains space separated integers.
Next queries follows, each query contains two integers and separated by a space.
Constraints
Output Format
For each query output if the value returned by Find(L,R) is even otherwise .
Sample Input
10 5
-8 -8 -8 4 -2 5 8 -5 1 2
2 9
8 10
1 3
3 4
6 8
Sample Output
Odd
Even
Even
Even
Even
Explanation
Query 2 : abs(abs(abs(-5) + 1) + 2) = 8 => Even
Query 3 : abs(abs(abs(-8) + (-8)) + (-8)) = 8 => Even
Query 4 : abs(abs(-8)+4) = 12 => Even
Query 5 : abs(abs(abs(5) + 8 )+(-5)) =>8 => Even
xxxxxxxxxx
with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada;
procedure Solution is
-- Enter your code here. Read input from STDIN. Print output to STDOUT
end Solution