Consecutive numbers for sum
Submissions: 556   Accuracy:

35.42%

  Difficulty: Easy   Marks: 2

Given a number N, find whether N can be expressed as sum of two or more consecutive positive numbers.

Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains an integer the number 'n'.

Output:
Print "Yes" (without quotes) if the number can be expressed as sum of two or more consecutive positive numbers and "No" (without quotes) if not.

Constraints:
1<=T<=10^5
1<=n<=10^5

Example:
Input:

3
10
8
24

Output:
Yes
No
Yes

 

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

Contributor: Ayush Govil
Author: Ayush Govil 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.



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

to report an issue on this page.