101792: [AtCoder]ABC179 C - A x B + C

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $300$ points

Problem Statement

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$

Output

Print the answer.


Sample Input 1

3

Sample 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)$.


Sample Input 2

100

Sample Output 2

473

Sample Input 3

1000000

Sample Output 3

13969985

Input

题意翻译

### 【题目描述】 给定一个正整数 $N$,计算有多少个正整数三元组 $(A,B,C)$ 满足 $A \times B + C = N$。 ### 【输入格式】 输入一行一个正整数 $N$。 ### 【输出格式】 输出一行一个整数,表示满足正整数三元组 $(A,B,C)$ 的个数。 ### 【样例解释】 样例 $\#1$ 中满足条件的三元组有:$(1,1,2),(1,2,1),(2,1,1)$。 ### 【数据范围】 - $2 \le N \le 10^6$。 - 输入全为正整数。 翻译由 @RP_INT_MAX 提供。

加入题单

算法标签: