#abc227c. C - ABC conjecture

C - ABC conjecture

Score : 300300 points

问题描述

你已知一个正整数 NN

找出满足条件 ABCA\leq B\leq CABCNABC\leq N 的正整数三元组 (A,B,C)(A, B, C) 的数量。

约束条件保证答案小于 2632^{63}

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a positive integer NN.

Find the number of triples of positive integers (A,B,C)(A, B, C) such that ABCA\leq B\leq C and ABCNABC\leq N.

The Constraints guarantee that the answer is less than 2632^{63}.

Constraints

  • 1N10111 \leq N \leq 10^{11}
  • NN is an integer.

Input

Input is given from Standard Input in the following format:

NN

Output

Print the answer.

Sample Input 1

4

Sample Output 1

5

There are five such triples: (1,1,1),(1,1,2),(1,1,3),(1,1,4),(1,2,2)(1,1,1),(1,1,2),(1,1,3),(1,1,4),(1,2,2).

Sample Input 2

100

Sample Output 2

323

Sample Input 3

100000000000

Sample Output 3

5745290566750

update @ 2024/3/10 09:57:04