atcoder#ABC147F. [ABC147F] Sum Difference
[ABC147F] Sum Difference
Score : points
Problem Statement
We have an integer sequence of length , where holds.
Takahashi will take some (possibly all or none) of the elements in this sequence, and Aoki will take all of the others.
Let and be the sum of the numbers taken by Takahashi and Aoki, respectively. How many possible values of are there?
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of possible values of .
3 4 2
8
is .
There are eight ways for (Takahashi, Aoki) to take the elements: $((), (4, 6, 8)), ((4), (6, 8)), ((6), (4, 8)), ((8), (4, 6))), ((4, 6), (8))), ((4, 8), (6))), ((6, 8), (4)))$, and .
The values of in these ways are , and , respectively, so there are eight possible values of .
2 3 -3
2
is . There are two possible values of : and .
100 14 20
49805