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

21071번 - Long Grid Covering 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB4231568730.526%

문제

We have a grid of height 3ドル$ and width $n,ドル as well as pieces that occupy 3ドル$ adjacent cells. Given $n,ドル determine the number of ways to fill the grid so that each cell is covered by exactly one piece and no piece sticks out of the grid. Here there is an example of a way to fill a grid of width 4ドル$:

Notice that any piece will be a rotation of one of the pieces of this example. Find the answers modulo 10ドル^9 + 7$.

입력

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

Each test case is given on a separate line containing an integer $n$ (1ドル \leq n \leq 10^{18}$), the width of the grid.

출력

For each test case, print a line with a single integer: the number of ways to fill the grid with aforementioned conditions modulo 10ドル^9 + 7$.

제한

예제 입력 1

3
1
2
3

예제 출력 1

1
3
10

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2021 > Day 2: UPC Contest L번

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

출처

대학교 대회

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

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