No.2480 Sequence Sum
問題文最終更新日: 2023-09-22 19:39:10
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
Problem Statement
Find the number of distinct possible lengths of sequences satisfying the following conditions.
- The sum is $N$.
- The elements that appear are of exactly $2$ distinct values, which are positive integers and adjacent numbers.
Input
$N$
Constraints
- $1 \leq N \leq 10^9$
- All inputs are integers.
Output
Output the answer on $1$ line.
Sample
Sample 1
Input
8
Output
4
For example, the sequence $(3,2,3)$ satisfies the conditions. Others such as $(1,1,2,1,1,1,1)$ also satisfy the conditions.
Sample 2
Input
12
Output
6
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
keisuke6