atcoder#ABC300G. [ABC300G] P-smooth number
[ABC300G] P-smooth number
Score : points
Problem Statement
A positive integer is called a -smooth number if none of its prime factors exceeds . Given an integer and a prime not exceeding , find the number of -smooth numbers not exceeding .
Constraints
- is an integer such that .
- is a prime such that .
Input
The input is given from Standard Input in the following format:
Output
Print the answer as an integer.
36 3
14
The -smooth numbers not exceeding are the following integers: . Note that is a -smooth number for all primes .
10000000000000000 97
2345134674