排列计数2

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Problem D. 排列计数2 (countb.c/cpp)

Time limit: 1 second Memory limit: 256 megabytes**

问题描述

给定一个长度为nn 的排列P=(P1,P2,...,Pn)P = (P_1, P_2, . . . , P_n),若PP 为好的当且仅当PP 的最长上升子序列长度不超过2。 当然,如果只是这样未免太索然无味了。所以小洞给你增加了一条限制, 他希望你能帮他求出,满足PA=BP_A = B 的好的排列数。

Input

一行三个整数n, A,B, 表示排列的长度和小洞的限制。

Output

输出一个整数,表示方案数对109+710^9 + 7 取模的结果。

Examples

输入样例1:

3 1 1

输出样例1:

1

唯一符合条件的排列是(1, 3, 2)

输入样例2:

12 3 4

输出样例2:

5390

Notes

本题共10 个测试点,其中第i 个测试点,n=10i2+1n = 10^{⌈ \frac{i}{2} ⌉}+1。 对100% 的数据,1A,Bn1 ≤ A,B ≤ n

提高组测试改题

Not Attended
Status
Done
Rule
IOI
Problem
16
Start at
2023-7-22 13:30
End at
2023-7-26 17:30
Duration
100 hour(s)
Host
Partic.
13