Non Fibonacci Number
Submissions: 708   Accuracy:

34.63%

  Difficulty: Easy   Marks: 2

Given a positive integer N, your task is to print the Nth non Fibonacci number. The Fibonacci numbers are defined as:

Fib(0) = 0

Fib(1) = 1

for n >1, Fib(n) = Fib(n-1) + Fib(n-2)
 

Input:
The first line of input contains a single integer T denoting the number of test cases. Then T test cases follow. Each test case consist of one line with a positive integer N.

 

Output:
Corresponding to each test case, in a new line, print the Nth non Fibonacci number. 

Constraints:

1 ≤ T ≤ 2000
1 ≤ N ≤ 105

Example:

Input
3

5

15

20

Output
10

22

27

** For More Input/Output Examples Use 'Expected Output' option **

Author: Hemang Sarkar


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.