#ABC169F. [ABC169F] Knapsack for All Subsets
[ABC169F] Knapsack for All Subsets
No testdata at current.
No submission language available for this problem.
Score : points
Problem Statement
Given are a sequence of positive integers , , , and another positive integer . For a non-empty subset of the set , let us define as follows:
- is the number of different non-empty subsets of such that .
Find the sum of over all subsets of . Since the sum can be enormous, print it modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the sum of modulo .
3 4
2 2 4
6
For each , the value of is shown below. The sum of these values is .
- (One subset satisfies the condition.)
- ()
- ()
- ()
- ()
5 8
9 9 9 9 9
0
10 10
3 1 4 1 5 9 2 6 5 3
3296