#arc147d. [arc147_d]Sets Scores
[arc147_d]Sets Scores
Problem Statement
Consider a sequence of integer sets of length : . We call a sequence brilliant if it satisfies all of the following conditions:
-
is a (possibly empty) integer set, and its elements are in the range \[1,M\].
-
The number of integers that is included in exactly one of and is .
We define the score of a brilliant sequence as the number of sets among that include ..
Find, modulo , the sum of the scores of all possible brilliant sequences.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 3
Sample Output 1
24
Among all possible brilliant sequences, the following have positive scores.
All of them have a score of , so the sum of them is .
Sample Input 2
12 34
Sample Output 2
786334067