SP5725 KSEQ - 123 Sequence
Description
A 123 sequence is defined as a non-decreasing sequence of length>=2, where each number is 1 or 2 or 3. The difference between all unique pairs of numbers is given i.e. for a 123 sequence a $ _{1} $ , a $ _{2} $ , a $ _{3} $ , ..., an the differences are a $ _{j} $ -a $ _{i} $ for 1
Input Format
First line of the input contains the number of test cases T. **T
Output Format
For each test case output the number of distinct 123 sequences in a separate line.