#cf16exhibitionfinalj. [cf16_exhibition_final_j]123 Pairs
[cf16_exhibition_final_j]123 Pairs
Problem Statement
#nck { width: 30px; height: auto; }
Consider all integers between and , inclusive. Snuke wants to divide these integers into pairs such that:
- Each integer between and is contained in exactly one of the pairs.
- In exactly pairs, the difference between the two integers is .
- In exactly pairs, the difference between the two integers is .
- In exactly pairs, the difference between the two integers is .
Note that the constraints guarantee that , thus no pair can have the difference of or more.
Compute the number of ways to do this, modulo .
Constraints
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3 1 2 0
Sample Output 1
2
There are two possibilities: or .
Sample Input 2
600 100 200 300
Sample Output 2
522158867