Sum of two Squares [Duplicate] (Deleted)
Submissions: 1295   Accuracy:

25.56%

  Difficulty: Basic   Marks: 1

Given an integer N, check if it is possible to represent it as a sum of two squares of integers.

Input:
First line of input contains an integer T, denoting number of test cases. Then T lines follow, each of them consisting of exactly one integer N.

 

Output:
For each test case output 1 if it is possible to represent given number as a sum of two squares and 0 if it is not possible.

 

Constraints:
1<=T<=100
1<=N<=10^6

 

Example:
Input:

3
1
2
7
Output:
1
1
0

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

Contributor: Saksham Raj Seth
Author: saksham seth


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.