#abc300g. G - P-smooth number
G - P-smooth number
Score : points
问题描述
一个正整数被称为 -光滑数,如果它的所有质因数都不超过 。
给定一个整数 和不超过 的质数 ,求不超过 的 -光滑数的数量。
以上为通义千问 qwen-max 翻译,仅供参考。
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.
Sample Input 1
36 3
Sample Output 1
14
The -smooth numbers not exceeding are the following integers: .
Note that is a -smooth number for all primes .
Sample Input 2
10000000000000000 97
Sample Output 2
2345134674
update @ 2024/3/10 08:24:56