#T2068. Counting Towers

Counting Towers

链接: https://cses.fi/problemset/task/2413

板块: Dynamic Programming

时限: 1.00 s | 内存: 512 MB

题目描述

Your task is to build a tower whose width is 22 and height is nn. You have an unlimited supply of blocks whose width and height are integers.

(题目原页含若干示意图片,此处从略。)

Given nn, how many different towers can you build? Mirrored and rotated towers are counted separately if they look different.

输入

The first input line contains an integer tt: the number of tests.

After this, there are tt lines, and each line contains an integer nn: the height of the tower.

输出

For each test, print the number of towers modulo 109+710^9+7.

数据范围

1t1001 \le t \le 100 1n1061 \le n \le 10^6

样例输入

3
2
6
1337

样例输出

8
2864
640403945