Salman Khan Upcoming Movie

0

0 votes
String, Dynamic Programming
Problem

Salman Khan has decided to release his upcoming movie on Eid 2020.As there is enough time in release of the movie, So Salman gives a task for his fans to construct the movie name which is  length long and formed using following rules:

Each letter is a vowel, i.e. is in the set {   }
The letter  may only be followed by the letter .
The letter  may only be followed by letter  or .
The letter  may not be next to another .
The letter  may only be followed by letter  or .
The letter  may only be followed by letter .

Now Salman is exicted to know how many distinct movie names he will got.As the number of distinct movie names may be very large so takes modulo with .

Input
The only line contains an integer, , the length of string.

Output
print an integer that represents the number of distinct movie names possible of length , modulo .

Sample Input
2
Sample Output
10
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

start with the string  and build to the right.
 may only be followed by , so the new string can be .
start with the string  and build to the right.
 may only be followed by  or , so the new string can be  or  .
start with the string  and build to the right.
 may not be followed by , so the new string can be .
start with the string  and build to the right.
 may only be followed by  or , so the new string can be  or  .
start with the string  and build to the right.
 may only be followed by , so the new string can be .
Total permutations  % .

Editor Image

?