Submit | All submissions | Best solutions | Back to list |
FIBTUTO - Fibonacci starters |
Fibo was a Famous Farmer. Who lived in the city of Fibonacia. One day while Farming For Fibonuts he saw a golden Fiboegg. He thought that now he will become a rich man with this golden Fiboegg. That night while he was sleeping a Fairy came in his dream and asked him did the Fiboegg came first or the golden Fibohen. So now come to the point: the Fibonacci series is a series in which every term is the sum of the previous two terms.
e.g. 0 1 1 2 3 5 8 13 ...
Your task is to print the SUM of the first N Fibonacci terms.
Input
First line of input will contain number of test cases T (<=1000), followed by T lines.
Every line will contain a positive integer N (<=90).
Output
For every input print the sum of first N Fibonacci numbers.
Example
Input: 2
5
8 Output: 7
33
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 |