Count of Sum of Consecutives Problem Statement
You are given a positive integer 'N'. Your objective is to determine the number of ways to express 'N' as the sum of two or more consecutive natural numbers.
Input:
The first line contains an integer, 'T', representing the number of test cases. Each test case consists of a single line with an integer 'N'.
Output:
Return an integer for each test case, indicating the number of ways to represent 'N' as the sum of 2 or more consecutive natural numbers.
Example:
Input:
2
9
15
Output:
2
3
Explanation:
For N = 9, the consecutive sums are: 2+3+4 = 9 and 4+5 = 9.
For N = 15, the consecutive sums are: 1+2+3+4+5 = 15, 4+5+6 = 15, and 7+8 = 15.
Constraints:
- 1 <= T <= 100
- 1 <= N <= 108
- Time Limit: 1 second
Be the first one to answer
Add answer anonymously...
Top Nvidia Software Developer Intern interview questions & answers
Popular interview questions of Software Developer Intern
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app