Staircase Sequences

AtCoder
IDabc190_d
Time2000ms
Memory256MB
Difficulty
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$ [samples]
Samples
Input #1
12
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]$
Input #2
1
Output #2
2

We have two such progressions:

*   $[1]$
*   $[0, 1]$
Input #3
963761198400
Output #3
1920
API Response (JSON)
{
  "problem": {
    "name": "Staircase Sequences",
    "description": {
      "content": "How many arithmetic progressions consisting of integers with a common difference of $1$ have a sum of $N$?",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc190_d"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "How many arithmetic progressions consisting of integers with a common difference of $1$ have a sum of $N$?\n\n## Constraints\n\n*   $1 ≤ N ≤ 10^{12}$\n*   $N$ is an integer.\n\n## Input\n\nInput is given from ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments