1365. B-Smooth Numbers

单点时限: 2.0 sec

内存限制: 256 MB

Let B be a positive integer. A natural number n is called B-smooth, if in its factorisation into primes there is no prime factor greater then B. We may say equivalently that a number n is called B-smooth, if it may be represented as a product of positive integers less then or equal to B.

Task

Write a program which:

1.reads three positive integers n, m and B,

2.determines the number of all B-smooth numbers in the interval [n,n+m] (inclusive),

3.writes the result.

输入格式

In the first line of the text there are three integers n, m and B, separated by single spaces, 1<=n<=2 000 000 000, 1<=m<=100 000 000, 1<=B<=1 000 000.

输出格式

Your program should write one integer in the first line. It should be the determined number of B-smooth numbers.

样例

Input
30 10 5
Output
4

1 人解决,3 人已尝试。

2 份提交通过,共有 13 份提交。

9.9 EMB 奖励。

创建: 17 年,3 月前.

修改: 7 年,2 月前.

最后提交: 3 年,12 月前.

来源: POI

题目标签