Submit | All submissions | Best solutions | Back to list |
LISTTUT - General Number Series |
Abhishek is very fond of series and he loves solving them. He thinks that no one can match his skills at series and so he throws a challenge at you.
The challenge is to determine the sum of the first N terms of the series.
The series is as: 0 1 2 6 20 56 144 352....
Be careful while finding the Nth term, it is not always determined by the starting terms ;)
Input
The first Line of input contains number of test cases T (<= 100), then T lines follow.
For each test case there will be a number N (<= 30).
Output
Output the sum of series until N terms
Example
Input: 2
2
5 Output: 1
29
Added by: | Rajesh Kumar |
Date: | 2012-09-02 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | ASM32-GCC MAWK BC C-CLANG C NCSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG COBOL COFFEE D-CLANG D-DMD DART ELIXIR FANTOM FORTH GOSU GRV JAVA JS-MONKEY JULIA KTLN NIM NODEJS OBJC OBJC-CLANG OCT PICO PROLOG PYPY PYPY3 PY_NBC R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA VB.NET |