Score : 1500 points
Consider all integers between 1 and 2N, inclusive. Snuke wants to divide these integers into N pairs such that:
Note that the constraints guarantee that N = A + B + C, thus no pair can have the difference of 4 or more.
Compute the number of ways to do this, modulo 10^9+7.
The input is given from Standard Input in the following format:
N A B C
Print the answer.
3 1 2 0
2
There are two possibilities: 1-2, 3-5, 4-6 or 1-3, 2-4, 5-6.
600 100 200 300
522158867