BETA

Submissions : 1822 Accuracy :

19.21

Sum of Consecutives
       

Given a number n, the task is to check whether it can be expressed as a sum of two or more consecutive numbers or not.

Examples:

Input  : n = 10 
Output : 1
It can be expressed as sum of two consecutive
numbers 1 + 2 + 3 + 4.

Input  : n = 16  
Output : 0
It cannot be expressed as sum of two consecutive
numbers.

Input  : n = 5  
Output : 1
2 + 3 = 5

 

Input:

 

The first line contains 'T' denoting the number of test cases. Then follows description of test cases.
Each test case contains a single positive integer n.


Output:
Print "1" if number can be expressed as sum of consecutives else "0". (Without the double quotes)


Constraints:
1<=T<=200
0<=N<=10^18

Example:
Input :
2
4
5

Output :
0
1

**For More Examples Use Expected Output**


Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



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