#P3789. Azuki loves coloring
Azuki loves coloring
Description
After the release of NEKOPARA Vol.3, Azuki, who is not the protagonist in the new work, can finally take a break. To pass the time, she starts coloring a sequence of cells, each cell being one of three colors: black, white, or gray. For aesthetics, Azuki wants no two black cells to be adjacent and no two white cells to be adjacent. There are many such sequences. Azuki defines the weight of a sequence as the number of occurrences where a black cell and a white cell are adjacent. For example, the weight of the sequence "gray black white black" is . Azuki wants to know, for each with , how many sequences of length have weight . Since the answers can be large, she only needs the values . Azuki promises that if you solve this problem, she will make you delicious cake.
Input Format
One line with two positive integers .
Output Format
One line with positive integers, representing the values of the numbers of sequences whose weights are .
3 3
11 4 2 0
20 10
1398101 4582670 8103780 10126770 9931780 8075094 5618340 3422330 1841460 893790 383524
Hint
For of the testdata, .
For of the testdata, , time limit . The remaining testdata have time limit .
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号