n개의 서로 다른 변수에 사칙연산과 괄호를 써서 만들 수 있는 유리식의 개수를, 유리함수로서 같은 것을 하나로 세어 1e9+7로 나눈 나머지를 구한다.
어려움9조합론수학동적 계획법정수론아직 제출이 없습니다시간 제한8초메모리 제한512 MBCharles enjoys learning. He often goes to the website Wikipedia to study computer science. Just now Charles seriously studied a series of expressions, in which algebraic expression has a great influence on him.
He is curious about how many different algebraic expressions built up from n distinct variables, elementary arithmetic operations (addition, subtraction, multiplication and division), and brackets such that each variable appears exactly once and each operation is after a variable or a pair of brackets. Can you help him calculate the answer in modulo (109 + 7)?
Two algebraic expressions in this problem are considered as equivalent if and only if they can be simplified as the same rational expression. For example, assuming a, b, c and d are variables, (a − d)/(b − c) is equivalent to (d − a)/(c − b), a/(b − c) ∗ d is equivalent to a/((b − c)/d), but a/b + c/d is not equivalent to d/c + b/a.
The first line contains one integer T, indicating the number of test cases.
Each of the following T lines describes a test case and contains only one integer n.
1 ≤ T, n ≤ 60 000.
For each test case, output the answer modulo (109 + 7) in one line.