Order Count

Time Limit: 2000/1000 MS (Java/Others)

Memory Limit: 65536/32768 K (Java/Others)

[显示标签]

Description

If we connect 3 numbers with "<" and "=", there are 13 cases:
1) A=B=C
2) A=B<C
3) A<B=C
4) A<B<C
5) A<C<B
6) A=C<B
7) B<A=C
8) B<A<C
9) B<C<A
10) B=C<A
11) C<A=B
12) C<A<B
13) C<B<A

If we connect n numbers with "<" and "=", how many cases then?

Input

The input starts with a positive integer P(0<P<1000) which indicates the number of test cases. Then on the following P lines, each line consists of a positive integer n(1<=n<=50) which indicates the amount of numbers to be connected.

Output

For each input n, you should output the amount of cases in a single line.

Sample Input

2 1 3

Sample Output

1 13
Hint
Hint
Huge input, scanf is recommended.

Hint

Ignatius.L

Source

杭州电子科技大学第三届程序设计大赛

提交代码