Adding 1, 2, and 3

No attempts yetTime limit1sMemory limit512 MB

Problem

There are 7 ways to write the integer 4 as a sum of 1, 2, and 3. A sum must use at least one number, and two sums that use the same numbers in a different order count as different ways.

  • 1+1+1+1
  • 1+1+2
  • 1+2+1
  • 2+1+1
  • 2+2
  • 1+3
  • 3+1

Given an integer nn, write a program that finds how many ways there are to write nn as a sum of 1, 2, and 3.

Input

The first line contains the number of test cases TT. Each test case is one line holding an integer nn. nn is positive and smaller than 11.

Output

For each test case, print the number of ways to write nn as a sum of 1, 2, and 3, one per line.