Banner Home Page DIY Contests Problems Ranklist Status Statistics

Fibonacci

Time Limit : 750/250ms (Java/Other)   Memory Limit : 65535/32768K (Java/Other)
Total Submission(s) : 15   Accepted Submission(s) : 7

Font: Times New Roman | Verdana | Georgia

Font Size: ¡û ¡ú

Problem Description

In mathematics, the Fibonacci numbers or Fibonacci sequence are the numbers in
the following integer sequence:
1, 1, 2, 3, 5, 8, 13, 21, 34, 55

By definition, the first two numbers in the Fibonacci sequence are 1 and 1, depending
on the chosen starting point of the sequence, and each subsequent number is the sum
of the previous two.
In mathematical terms, the sequence Fn of Fibonacci numbers is defined by the recurrence
relation
F[n] = F[n-1] + F[n-2]
with seed values
F[1] = 1 F[2] = 1
Fibonacci sequence in decimal: 1,1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
Now Mummy writes them in binary :
1,1, 10, 11, 101, 1000, 1101, 10101, 100010, 110111, 1011001,
and he wants to know the sum of digits in every Fibonacci number(Binary Form) and
the result of the Fibonacci number(Decimal Form).

Input

Input consists of several lines of integer numbers. The first line contains an integer t,
which is the number of cases to be tested, followed by t lines,
one integer 1 <= m <= 90 on each line.

Output

The output contains the sum of digits in F[m](Binary form) and
the result of the Fibonacci number(Decimal Form).

Sample Input

2
2 
7 

Sample Output

1 1
4 13

Author

MummyDing

Statistic | Submit | Back