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

33184번 - Jackson House 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB888100.000%

문제

Jackson, after witnessing the advancements in the world of technology, decided to sell his small cozy house and enroll in the programming-and-algorithm micromaster. He came across an interesting algorithm that he needed to analyze and solve the problem related to it, in order to pass the exam at this stage of the course. The pseudocode of this algorithm is as follows:

input: a permutation $π = <π_1, π_2, \dots , π_n>$ of numbers $\{1, 2, \dots , n\}$
while $π$ is changing during this iteration:
 for $i := n$ downto 2ドル$:
 if $π_i < π_{\lfloor i/2 \rfloor}$:
 swap($π_i,ドル $π_{\lfloor i/2 \rfloor}$)

He wants to know for how many permutations $π$ of length $n$ from the possible $n!$ ones, the final permutation will be sorted after running this algorithm.

입력

The first line contains an integer $t$ (1ドル \le t \le 100$), the number of test cases.

Each of the next $t$ lines contains an integer $n_i$ (2ドル \le n_i \le 10^9$), representing the length of the permutation for the $i$th test case.

출력

Output $t$ lines. On the $i$th line, print the number of permutations of length $n_i$ which will be sorted after running the provided algorithm on it. Since the output could be very large, output the result modulo 10ドル^9 + 7$.

제한

예제 입력 1

4
3
5
10
20

예제 출력 1

4
16
1728
23887872

힌트

출처

ICPC > Regionals > Asia West Continent > Iran > 2023 ICPC Asia Tehran Regional Contest G번

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

출처

대학교 대회

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

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