SEQ6  Consecutive sequence
We define consecutive sequence as a sequence of integer numbers {n, n+1, n+2, ..., n+m}. For each given positive integer N ≤ 10^{7} calculate number of such sequences which sum is equal to N.
Input
The input file consists of multiple lines (about 10^{3} in the first data set and 10^{5} in the second), each line contains integer N. The input is terminated with N = 0, which should not be processed.
Output
Expected number in each line
Example
Input: 500 0 Output: 8
hide comments
Francky:
20141207 16:10:01
This problem had been switched to cube since a while. Rejudge hadn't been done yet. 

Rohan Phadke:
20141012 07:55:37
A brilliant problem! Had SO much fun solving it! :D Last edit: 20140613 00:56:20 

Francky:
20141012 07:55:37
Excellent problem, (quite) strong cases.


pankaj bhardwaj:
20141012 07:55:37
good question indeed


Massand Sagar Sunil:
20141012 07:55:37
Is m positive? 

(Tjandra Satria Gunawan)(æ›¾æ¯…æ˜†):
20141012 07:55:37
"For each given positive integer N < 10^7 calculate number of such sequences which sum is equal to N."


vipin:
20141012 07:55:37
Why am I always getting tle? its O(sqrt(n)) algorithm..:( Last edit: 20110904 14:22:23 

Gurpreet Singh:
20141012 07:55:37
Any Hints!!!!!!!!


The Champ:
20141012 07:55:37
i am getting TLE while my code gives answer within fractions of seconds. for 999999 my answer is 112, can someone give me a corner case..

Added by:  Ruslan Sennov 
Date:  20100514 
Time limit:  9s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: PERL6 