D - Staircase Sequences
Editorial
/


Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 400 点
問題文
整数からなる公差 1 の等差数列のうち、総和が N であるものはいくつあるでしょうか?
制約
- 1 ≤ N ≤ 10^{12}
- N は整数
入力
入力は以下の形式で標準入力から与えられる。
N
出力
答えを出力せよ。
入力例 1
12
出力例 1
4
- [12]
- [3, 4, 5]
- [-2, -1, 0, 1, 2, 3, 4, 5]
- [-11, -10, -9, \dots, 10, 11, 12]
の 4 個です。
入力例 2
1
出力例 2
2
- [1]
- [0, 1]
の 2 個です。
入力例 3
963761198400
出力例 3
1920
Score : 400 points
Problem Statement
How many arithmetic progressions consisting of integers with a common difference of 1 have a sum of N?
Constraints
- 1 ≤ N ≤ 10^{12}
- N is an integer.
Input
Input is given from Standard Input in the following format:
N
Output
Print the answer.
Sample Input 1
12
Sample Output 1
4
We have four such progressions:
- [12]
- [3, 4, 5]
- [-2, -1, 0, 1, 2, 3, 4, 5]
- [-11, -10, -9, \dots, 10, 11, 12]
Sample Input 2
1
Sample Output 2
2
We have two such progressions:
- [1]
- [0, 1]
Sample Input 3
963761198400
Sample Output 3
1920