Given an array
l r
return the number of subsequences between indexl
tor
(inclusive) which have an even sum.
As the results of these queries may be extremely large, output them modulo
A subsequence can be created from
Constraints
For all subtasks:
Points Awarded | Additional Constraints |
---|---|
3 points | All |
5 points | |
7 points | No further constraints |
Input Specification
The first line contains two space-separated integers
The next line contains
The next
Output Specification
Output the answer to each query in order on separate lines.
Sample Input
Copy
6 1
4 3 1 2 5 7
2 4
Sample Output
Copy
3
Comments