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
hide comments
studyfather:
2017-07-24 14:29:25
111B? Are you kidding me???
|
|
dwij28:
2016-01-14 01:21:50
Phew AC : 92 (python 2.7)
|
|
deathgun:
2014-12-27 19:53:00
not able to upload 105 byte python code. judge saying too long :(
|
|
nitish rao:
2014-10-18 09:31:40
112 bytes in Python.. :'(
|
|
RIVU DAS:
2014-06-04 19:36:09
Its hard to do in C!! |
|
Carlos Eduardo Díaz Valbuena:
2013-11-30 17:26:59
in java it's impossible in less than 111B |
|
Mostafa 36a2:
2013-11-30 17:26:59
$ওয়াসী (Wasi) : Congratulations :) Keep going man ;)
|
|
ওয়াসী (Wasi):
2013-11-30 17:26:59
@Mostafa 36a2 (Al3ayesh) try this one! |
|
ওয়াসী (Wasi):
2013-11-30 17:26:59
44B in AWK :(
|
|
Ouditchya Sinha:
2013-11-30 17:26:59
Finally AC, good property of Fibonacci Series! :) |
Added by: | HWK |
Date: | 2011-03-25 |
Time limit: | 1s |
Source limit: | 111B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |