#P5946. [POI 2002] B-Smooth 数

[POI 2002] B-Smooth 数

Problem Description

BB is a positive integer.

If a natural number nn is called a B-smooth number, then none of its prime factors is greater than BB.

We say that a B-smooth number equivalent to nn means that it can be represented as a product of positive integers less than or equal to BB.

Your task is: for the given closed interval [n,n+m][n, n + m], find the number of B-smooth numbers in it.

Input Format

The first line contains three integers nn, mm, and BB.

Output Format

Output the number of B-smooth numbers.

30 10 5
4

Hint

For 100%100\% of the testdata, 1n2×1091 \le n \le 2 \times 10^9, 1m1081 \le m \le 10^8, 1B1061 \le B \le 10^6.

Translated by ChatGPT 5