The Fibonacci-prime number
Submissions: 1346   Accuracy:

12.98%

  Difficulty: Medium   Marks: 4

Given a number N, you need to find if N is fibonacci-prime number or not. A fibonacci-prime is any number that is both a prime and a fibonacci number.

Input:
The first line of the input contains a single integer T, denoting the number of test cases. Then T testcases follow. Each testcase contains a single line of input denoting the value of N.

Output:
For each testcase, print 1 if N is a fibonacci-prime; print 0 if N is not a fibonacci-prime.

Constraints:
1<=T<=120
2<=N<=1075

Example:

Input:
3
2
3
4

Output:
1
1
0

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

Contributor: Ankit Sharma
Author: Soul_xhacker


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.