|All-time Popular Problems|
|Delete without head pointer|
|Check if a number is power of another number|
|Array to BST|
|Implement Queue using Linked List|
|Lowest Common Ancestor in a BST|
|Reverse a Linked List in groups of given size.|
|Print all nodes that don’t have sibling|
|Equal to product|
Given 3 characters a, b, c. Find the number of strings of length n that can be formed from these 3 characters. Given that : we can use ‘a’ as many times as we want, ‘b’ maximum once, and ‘c’ maximum twice.
The first line of input contains an integer T denoting the number of test cases. The first and last line of each test case consists of an integer n.
Print the total number of string that can be formed.