Given an integer N, check if it is possible to represent it as a function(a, b) such that : a2 + b2 = N where "a" and "b" are whole numbers.
The 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.
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.
1 = 02 + 12 : Hence Possible : Output = 1
2 = 12 + 12 : Hence Possible : Output = 1
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.