AmzMohammad is a novice problem setter in Spoj. for start of his work he decided to write a classical and sample problem. (for UI ACM summer program )
how many N-words (words with N letters) from the alphabet {0,1,2} are such that neighbors differ at most by 1?
a positive integer N.
Number of N-words with told conditions.
answer is less than 1000000000. it is the only constraint :)
Input: 2 Output: 7