P23644 [AtCoder] Flexible Permutation
省选
题目描述

Problem Description

Given a positive integer $N$.

The sequence $P_1, P_2, \ldots, P_N$ which is a permutation of $1, 2, \ldots, N$ has $N!$ possibilities. Write a program to find the number of such permutations that satisfy the following conditions, modulo $10^9 + 7$.

  • There are exactly $A$ indices $i$ ($= 1, 2, \dots, N$) such that $P_i > i$,
  • There are exactly $B$ indices $i$ ($= 1, 2, \dots, N$) such that $P_i < i$,
  • There are exactly $N - A - B$ indices $i$ ($= 1, 2, \dots, N$) such that $P_i = i$.

Input Format

The input is given from the standard input in the following format:

$N$ $A$ $B$

Output Format

Output the number of permutations that satisfy the conditions, modulo $10^9 + 7$, in one line.

Sample Input and Output

Sample Input #1

3 1 1

Sample Output #1

3

Sample Input #2

6 2 3

Sample Output #2

126

Sample Input #3

10 5 0

Sample Output #3

0

Sample Input #4

256 155 51

Sample Output #4

125746759

Notes/Hints

Constraints

  • $1 \le N \le 300$
  • $0 \le A, B \le N$
  • $A + B \le N$
  • All given inputs are integers.

Partial Points

This problem has partial points.

  • Correct answer for inputs satisfying $N \leq 15$ will award $300$ points.

Sample Explanation 1

The $3$ permutations $(1, 3, 2), (3, 2, 1), (2, 1, 3)$ satisfy the conditions.

Sample Explanation 3

There may be no permutations that satisfy the conditions.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 1 1
样例输出
3