#P6267. [SHOI2002] N的连续数拆分

[SHOI2002] N的连续数拆分

Description

All positive integers can be represented as the sum of one, two, or more consecutive positive integers.

Given a positive integer not exceeding 9×10149\times 10^{14}, find how many different ways it can be represented as a sum of consecutive positive integers. For example, for 99, there are three ways: 99, 4+54+5, 2+3+42+3+4.

Input Format

Input a positive integer nn, which is the integer to be decomposed.

Output Format

Output the number of methods.

9
3
11
2
12
2

Hint

n9×1014n \leq 9\times 10^{14}.

Translated by ChatGPT 5