Score : $500$ points
How many ways are there to arrange $N$ white balls and $M$ black balls in a row from left to right to satisfy the following condition?
Since the count can be enormous, find it modulo $(10^9 + 7)$.
Input is given from Standard Input in the following format:
$N$ $M$ $K$
Print the answer. Be sure to find the count modulo $(10^9 + 7)$.
2 3 1
9
There are $10$ ways to arrange $2$ white balls and $3$ black balls in a row, as shown below, where w
and b
stand for a white ball and a black ball, respectively.
wwbbb
wbwbb
wbbwb
wbbbw
bwwbb
bwbwb
bwbbw
bbwwb
bbwbw
bbbww
Among them, wwbbb
is the only one that does not satisfy the condition. Here, there are $2$ white balls and $0$ black balls among the $2$ leftmost balls, and we have $2 > 0 + K = 1$.
1 0 0
0
There may be no way to satisfy the condition.
1000000 1000000 1000000
192151600
Be sure to print the count modulo $(10^9 + 7)$.