题库练习 TediousLee
← 上一题 下一题 →

A13484 | TediousLee

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Lee tried so hard to make a good div.2 D problem to balance his recent contest, but it still doesn't feel good at all. Lee invented it so tediously slow that he managed to develop a phobia about div.2 D problem setting instead. And now he is hiding behind the bushes...

Let's define a Rooted Dead Bush (RDB) of level $n$ as a rooted tree constructed as described below.

A rooted dead bush of level $1$ is a single vertex. To construct an RDB of level $i$ we, at first, construct an RDB of level $i-1$ , then for each vertex $u$ :

- if $u$ has no children then we will add a single child to it;
- if $u$ has one child then we will add two children to it;
- if $u$ has more than one child, then we will skip it.

![](/uploads/acgo/image/34bcce2f436c730e_b34bbc4cadee.jpeg)Rooted Dead Bushes of level $1$ , $2$ and $3$ . Let's define a claw as a rooted tree with four vertices: one root vertex (called also as center) with three children. It looks like a claw:

![](/uploads/acgo/image/806b1e08365da2ea_d9fcdca58f0d.jpeg)The center of the claw is the vertex with label $1$ . Lee has a Rooted Dead Bush of level $n$ . Initially, all vertices of his RDB are green.

In one move, he can choose a claw in his RDB, if all vertices in the claw are green and all vertices of the claw are children of its center, then he colors the claw's vertices in yellow.

He'd like to know the maximum number of yellow vertices he can achieve. Since the answer might be very large, print it modulo $10^9+7$ .

输入格式

The first line contains one integer $t$ ( $1 \le t \le 10^4$ ) — the number of test cases.

Next $t$ lines contain test cases — one per line.

The first line of each test case contains one integer $n$ ( $1 \le n \le 2 \cdot 10^6$ ) — the level of Lee's RDB.

输出格式

For each test case, print a single integer — the maximum number of yellow vertices Lee can make modulo $10^9 + 7$ .

输入输出样例

输入 #1
7
1
2
3
4
5
100
2000000
输出 #1
0
0
4
4
12
990998587
804665184
C++ 编辑器
输入
输出