#P5303. [GXOI/GZOI2019] 逼死强迫症
[GXOI/GZOI2019] 逼死强迫症
Description
ITX351 wants to pave a road, so he bought bricks. However, one brick cracked in the middle during transportation and became two blocks.
This gave ITX351 an evil idea: he wants to deliberately place the two blocks separately on the road, making sure the two blocks do not share any adjacent edge. The other bricks can be placed in any way, until the whole road is fully covered. This will surely drive his own OCD (sea5) crazy!
Maybe you have already guessed what happens next—he got so excited that he could not type anymore. So he asks you to help compute how many different ways there are to make his plot succeed.
Input Format
Each test point contains multiple test cases. The first line of the input file is a positive integer , which denotes the number of test cases. Note that different test cases are independent.
The next lines each contain a positive integer , representing the length of the road in that test case.
Output Format
The output should contain lines. For each test case, output a positive integer, representing the number of valid tilings that satisfy the condition.
Since the answer may be very large, you only need to output the result modulo .
3
1
2
4
0
0
6
Hint
For the sample, the explanation for is shown in the figure below:

Constraints
| Test point ID | Scale of | Scale of |
|---|---|---|
Translated by ChatGPT 5
京公网安备 11011102002149号