


Fn = F(n-1) + F(n-2)
The first line contains a single integer ‘T’ representing the number of test cases.
The first line of each test case will contain a single integer ‘N’ which denotes the given number that has to check whether it is a Fibonacci number or not.
For each test case, print the “YES” if the number is a Fibonacci number. Otherwise, print “NO”.
Output for every test case will be printed in a separate line.
You don’t need to print anything; It has already been taken care of.
1 <= T <= 100
0 <= N <= 100000
Where ‘T’ is the number of test cases.
Where 'N' is the given number.
Time limit: 1 sec
The basic idea is to keep generating Fibonacci numbers until we find a number equal to the given number or the generated number becomes greater than the given number. If the generated number is equal to the given number then it means the given number is a Fibonacci number. Otherwise, it is not a Fibonacci number.
The basic idea of this approach is to check whether (5*n*n + 4) or (5*n*n - 4) is a perfect square or not. If they are, then ‘n’ is a Fibonacci number.
The steps are as follows: