Non-Fibo
Practice
4.2 (8 votes)
Mathematics
Medium
Open
Approved
Number theory
Problem
50% Success 1134 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Seeing the fame received by the Fibonacci numbers, the other Natural Numbers were feeling jealous. Therefore, to give them their shot at glory Mr. Non-Fibo now wants you to tell him the Nth- Non Fibonacci Number.
Input:
First line contains T which is the number of test cases.
T lines follow each with an integer N.
Output:
For each N output the Nth Non-Fibonacci number.
Constraints:
- 1 ≤ T ≤ 105
- 1≤ N ≤ 1015
Scoring:
- 1 ≤ T ≤ 105,1 ≤ N ≤ 105 : ( 30 pts )
- 1 ≤ T ≤ 105,1 ≤ N ≤ 109 : ( 30 pts )
- 1 ≤ T ≤ 105,1 ≤ N ≤ 1015 : ( 40 pts )
Submissions
Please login to view your submissions
Similar Problems
Points:30
27 votes
Tags:
Graph TheoryLinear AlgebraApprovedMediumAlgorithmsMathematicsOpenMatrix Exponentiation
Points:30
Tags:
Medium
Points:30
9 votes
Tags:
Linear AlgebraDynamic ProgrammingAlgorithmsMatrix ExponentiationMath
Editorial