atcoder#ABC258H. [ABC258Ex] Odd Steps
[ABC258Ex] Odd Steps
Score : points
Problem Statement
Find the number, modulo , of sequences that satisfy all of the following conditions.
- Every term in is a positive odd number.
- The sum of the terms in is .
- The prefix sums of contain none of . Formally, if we define for each , then holds for all integers and such that and .
Constraints
- $1 \leq A_1 \lt A_2 \lt \dots \lt A_N \lt S \leq 10^{18}$
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3 7
2 4 5
3
The following three sequences satisfy the conditions.
5 60
10 20 30 40 50
37634180
10 1000000000000000000
1 2 4 8 16 32 64 128 256 512
75326268