3031: Brackets

时间限制:1000 ms 内存限制:128 MB
上传者:
提交:1 通过:1

题目描述

Let us define a regular brackets sequence in the following way:
  • Empty sequence is a regular sequence.
  • If “S” is a regular sequence, then “(S)” is a regular sequence.
  • If “A” and “B” are regular sequences, then “AB” is a regular sequence.
For example, all of the following sequences are regular brackets sequences: “()”, “(())”, “()()”, “()(())”.

And all of the following sequences are not: “(”, “)”, “)(”, “((()”.

Doc has $n$ pairs of brackets and he wants to know how many regular brackets sequences of length $2n$ can he construct that satisfy the x-th left bracket must not be matched before the y-th left bracket is matched($x < y$), tell him the answer modulo $10^9+ 7$.

输入格式

The first line contains an integer number T($T \leq 200$), the number of test cases.

i-th of each next T lines contains three numbers $n$, $x$, $y$($2 \leq n \leq 500$, $1 \leq x < y \leq n$).

输出格式

For each test case print the answer modulo $10^9+ 7$.

输入样例 复制

3
2 1 2
6 2 4
15 9 10

输出样例 复制

1
57
4566642