BETA

Difficulty Level: Basic

Submissions: 693 Accuracy:

27.71%

Fibonacci in the array
       

We are given an array and our task is to check if the elements of the array are present in Fibonacci series or not. Give the count of such numbers in the array.

Input:
The first line of input contains an integer T denoting the number of test cases. Each test case contains an integer n which denotes the number of elements in the array a[]. Next line contains space separated n elements in the array a[].

Output:
Print an integer which denotes the count of Fibonacci numbers in the array.

Constraints:
1<=T<=100
1<=n<=1000
1<=a[i]<=10000

Example:
Input:

2
9
4 2 8 5 20 1 40 13 23
5
1 2 3 4 5

Output:
5
4

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

Contributor: Shashwat Jain

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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