BETA

Difficulty Level: Medium

Submissions: 203 Accuracy:

10.84%

[The Fibonacci-prime number]
           

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

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.