55 1 s 128 MB
A string of letters A, B, C is forbidden if there are three consecutive letters from which one is A, one is B, and one is C. For example, BAACAACCBAAA is forbidden, while AABBCCAABB is not.
For each test case, print the how many such strings of length n are not forbidden. Answer can larger than 2^32.
3 2 3 4
9 21 51