#GESPC520240302. GESP-2024年3月份 C++五级 编程题2 B-smooth 数

GESP-2024年3月份 C++五级 编程题2 B-smooth 数

BB-smoothsmooth

题目描述

小杨同学想寻找⼀种名为 BB-smoothsmooth 数的正整数。 如果⼀个正整数的最大质因子不超过BB,则该正整数为 BB-smoothsmooth 数。 小杨同学想知道,对于给定的 nnBB ,有多少个不超过 nnBB-smoothsmooth 数。

输入格式

第⼀行包含两个正整数 nnBB ,含义如题⾯所示。

输出格式

输出⼀个非负整数,表⽰不超过 nnBB-smoothsmooth 数的数量。

样例

样例输入 #1

10 3

样例输出 #1

7

样例解释

在不超过1010的正整数中,BB-smoothsmooth 数有{1,2,3,4,6,8,9} ,共 7 个。

数据范围

image