# 题目相关

## 题目链接

AtCoder Beginner Contest 179 C 题，https://atcoder.jp/contests/abc179/tasks/abc179_c

## Problem Statement

Given is a positive integer N. How many tuples (A,B,C) of positive integers satisfy A×B+C=N.

## Input

Input is given from Standard Input in the following format:

N

## Samples1

### Sample Input 1

3

### Sample Output 1

3


### Explaination

There are 3 tuples of integers that satisfy A×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

## Constraints

• 2 ≤ N ≤ 10^6
• All values in input are integers.

# 题解报告

## 样例数据分析

### 样例 1

 A B C 是否满足 ans 1 1 2 满足 1 1 2 1 满足 2 1 3 0 不满足 2 2 1 1 满足 3 3 1 0 不满足 3

## AC 参考代码

//https://atcoder.jp/contests/abc179/tasks/abc179_
#include <iostream>

using namespace std;

int main() {
int n;
cin>>n;

unsigned long long ans=0;
for (int a=1; a<n; a++) {
for (int b=1; b<=n/a; b++) {
int c=n-a*b;
if (c>0 && n==a*b+c) {
ans++;
}
}
}

cout<<ans<<"\n";

return 0;
}

02-23 546