atcoder#ARC143F. [ARC143F] Counting Subsets
[ARC143F] Counting Subsets
Score : points
Problem Statement
Given a positive integer , find the number, modulo , of subsets of that satisfy the following condition.
- Every positive integer at most can be represented as the sum of some distinct elements of , and there are at most two such representations.
Constraints
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3
2
The subsets and satisfy the condition.
5
5
1000
742952024