CF222E Decoding Genome

Description

Recently a top secret mission to Mars has taken place. As a result, scientists managed to obtain some information about the Martian DNA. Now we know that any Martian DNA contains at most $ m $ different nucleotides, numbered from $ 1 $ to $ m $ . Special characteristics of the Martian DNA prevent some nucleotide pairs from following consecutively in this chain. For example, if the nucleotide 1 and nucleotide 2 can not follow consecutively in the Martian DNA, then the chain of nucleotides \[1, 2\] is not a valid chain of Martian DNA, but the chain of nucleotides \[2, 1\] can be a valid chain (if there is no corresponding restriction). The number of nucleotide pairs that can't follow in the DNA chain consecutively, is $ k $ . The needs of gene research required information about the quantity of correct $ n $ -long chains of the Martian DNA. Your task is to write a program that will calculate this value.

Input Format

N/A

Output Format

N/A

Explanation/Hint

In the second test case all possible three-nucleotide DNAs are permitted. Each nucleotide can take one of three values, thus in total there are 27 distinct three nucleotide DNAs. In the third test sample we cannot make any DNA of two nucleotides — the only possible nucleotide "a" cannot occur two times consecutively.