Logo
(追記) (追記ここまで)

18568번 - Lost In The Echo 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
8 초 512 MB422100.000%

문제

Charles 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.

제한

예제 입력 1

6
1
2
3
4
5
6

예제 출력 1

1
6
68
1170
27142
793002

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2019 > Day 2: Jingzhe Tang Contest L번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /