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

5392번 - The Twin Tower 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB49272455.814%

문제

In recent years so many twins enrolled at Leiden University, that housing them has become a big problem. In an effort to accomodate everyone, the university has made plans to build a skyscraper of N floors high, with 9 rooms on each floor, laid out in a 3 × 3 square. According to these plans, everyone should be able to get a room next to or directly above or below their twin brother or sister. To be even more precise: the two rooms of a twin should either be at opposite sides of a common wall, or the floor of one room should be the ceiling of the other. For the sake of privacy, students never share a room.

Today the university has tasked some poor soul (you!) to count all possible pairings of rooms that leave no room unpaired, modulo 10, 007.

입력

The first line of the input contains a single number: the number of test cases to follow. Each test case has the following format:

  • One line with an integer N, satisfying 0 ≤ N ≤ 5, 000.

출력

For every test case in the input, the output should contain a single number, on a single line: the number of possible configurations modulo 10, 007.

제한

예제 입력 1

4
2
4
1576
2680

예제 출력 1

229
7728
229
7728

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2010 C번

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

출처

대학교 대회

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

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