A x B + C

AtCoder
IDabc179_c
Time2000ms
Memory256MB
Difficulty
Given is a positive integer $N$. How many tuples $(A,B,C)$ of positive integers satisfy $A \times B + C = N$? ## Constraints * $2 \leq N \leq 10^6$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
3
Output #1
3

There are $3$ tuples of integers that satisfy $A \times B + C = 3$: $(A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1)$.
Input #2
100
Output #2
473
Input #3
1000000
Output #3
13969985
API Response (JSON)
{
  "problem": {
    "name": "A x B + C",
    "description": {
      "content": "Given is a positive integer $N$. How many tuples $(A,B,C)$ of positive integers satisfy $A \\times B + C = 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": "abc179_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given is a positive integer $N$. How many tuples $(A,B,C)$ of positive integers satisfy $A \\times B + C = N$?\n\n## Constraints\n\n*   $2 \\leq N \\leq 10^6$\n*   All values in input are integers.\n\n## Input\n...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments