FIBSUM - Sum of Fibonacci numbers
Given the ith (1<=i<=35) Fibonacci number Fi calculate the sum of the ith till i+9th number Fi+Fi+1+...+Fi+9 and the last digit of the i+246th one Fi+246.
Be careful: Your solution mustn't exceed 111 bytes. But rather half of it should be more than enough.
Score is source length.
Input
In the first line the number of testcases N<=100, then N lines with one positive integer i.
Output
One line with "Fi+Fi+1+...+Fi+9+last digit of Fi+246" for each i.
Example
Input: 2
1
35 Output: 146
1821381552
Added by: | HWK |
Date: | 2011-03-25 |
Time limit: | 1s |
Source limit: | 111B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |