#P8784. [蓝桥杯 2022 省 B] 积木画

[蓝桥杯 2022 省 B] 积木画

Problem Description

Xiaoming has recently become interested in block paintings. There are two types of blocks: the II block (area of 22 unit squares) and the LL block (area of 33 unit squares):

I block

At the same time, Xiaoming has a canvas of size 2×N2 \times N. The canvas consists of 2×N2 \times N regions of size 1×11 \times 1. He needs to completely fill the canvas using the two types of blocks above, and he wants to know how many different ways there are in total. The blocks can be rotated freely, and the orientation of the canvas is fixed.

Input Format

Input an integer NN, representing the canvas size.

Output Format

Output an integer representing the answer. Since the answer may be very large, output the value modulo 10000000071000000007 (i.e. 109+710^9+7).

3
5

Hint

Sample Explanation

The five cases are shown in the figure below. The colors are only used to distinguish different blocks.

Constraints

For all testdata, 1N1071 \leq N \leq 10^7.

Lanqiao Cup 2022 Provincial Contest B Group, Problem G.

Translated by ChatGPT 5