QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 32 MB 總分: 100

#11494. B-Smooth 数

统计

令 $B$ 为一个正整数。如果一个自然数 $n$ 的质因数分解中不存在大于 $B$ 的质因数,则称该数为 $B$-光滑数。等价地说,如果一个数 $n$ 可以表示为若干个小于或等于 $B$ 的正整数的乘积,则称该数为 $B$-光滑数。

任务

编写一个程序,完成以下操作:

  • 从标准输入读取三个正整数 $n$、$m$ 和 $B$;
  • 确定区间 $[n, n+m]$(包含端点)中所有 $B$-光滑数的个数;
  • 将结果输出到标准输出。

输入格式

标准输入的第一行包含三个整数 $n$、$m$ 和 $B$,以空格分隔,其中 $1 \le n \le 2\,000\,000\,000$,$1 \le m \le 100\,000\,000$,$1 \le B \le 1\,000\,000$。

输出格式

程序应在标准输出的第一行输出一个整数,即所求的 $B$-光滑数的个数。

样例

输入 1

30 10 5

输出 1

4

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.