atcoder#ABC267H. [ABC267Ex] Odd Sum
[ABC267Ex] Odd Sum
Score : points
Problem Statement
You are given a sequence of length .
Find the number, modulo , of ways to choose an odd number of elements from so that the sum of the chosen elements equals .
Two choices are said to be different if there exists an integer such that one chooses but the other does not.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
5 6
1 2 3 3 6
3
The following choices satisfy the condition:
- Choosing , , and .
- Choosing , , and .
- Choosing .
Choosing and does not satisfy the condition because, although the sum is , the number of chosen elements is not odd.
10 23
1 2 3 4 5 6 7 8 9 10
18