Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 300 点
問題文
正の整数 K が与えられます。正の整数の 3 つ組 (A,B,C) であって、ABC\leq K なるものの個数を求めてください。 ただし、A,B,C の順番が異なるだけの組も異なる組として数えます。
制約
- 1\leq K\leq 2\times 10^5
- K は整数である
入力
入力は以下の形式で標準入力から与えられる。
K
出力
正の整数の 3 つ組 (A,B,C) であって、ABC\leq K なるものの個数を出力せよ。
入力例 1
2
出力例 1
4
(1,1,1),(1,1,2),(1,2,1),(2,1,1) が条件を満たします。
入力例 2
10
出力例 2
53
入力例 3
31415
出力例 3
1937281
Score : 300 points
Problem Statement
Given a positive integer K, find the number of triples of positive integers (A, B, C) such that ABC \leq K. Two triples that only differ in the order of numbers are also distinguished.
Constraints
- 1\leq K\leq 2\times 10^5
- K is an integer.
Input
Input is given from Standard Input in the following format:
K
Output
Print the number of triples of positive integers (A, B, C) such that ABC \leq K.
Sample Input 1
2
Sample Output 1
4
We have the following triples: (1,1,1),(1,1,2),(1,2,1),(2,1,1).
Sample Input 2
10
Sample Output 2
53
Sample Input 3
31415
Sample Output 3
1937281