QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 256 MB Puntuación total: 100 Hackeable ✓

#10843. LCM 与 GCD

Estadísticas

给定两个整数 $x$ 和 $k$。你的任务是确定满足以下条件的集合总数:该集合包含恰好 $k$ 个不同的正整数 $a_1, a_2, \dots, a_k$,且它们的最小公倍数(LCM)与最大公约数(GCD)之和等于 $x$,即 $\text{LCM}(a_1, a_2, \dots, a_k) + \text{GCD}(a_1, a_2, \dots, a_k) = x$。

一个集合中数字的 LCM 是能被集合中每个数字整除的最小正整数,而 GCD 是能整除集合中每个数字的最大正整数。例如,$\text{LCM}(4, 6, 8) = 24$ 且 $\text{GCD}(4, 6, 8) = 2$。

由于结果可能非常大,你需要输出结果对 $10^9 + 7$ 取模后的值。

输入格式

一行包含两个整数 $x$ 和 $k$ ($1 \le x, k \le 10^9$)。

输出格式

输出一个整数,表示答案对 $10^9 + 7$ 取模后的结果。

样例

样例输入 1

14 2

样例输出 1

3

样例输入 2

14 3

样例输出 2

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.