QOJ.ac

QOJ

حد الوقت: 2 s حد الذاكرة: 256 MB مجموع النقاط: 100 قابلة للهجوم ✓

#13509. 果冻氧气豆

الإحصائيات

你认为吃糖是一件简单的事吗?事实上,当它们是氧气糖时,情况就并非如此了。

由于你喜欢一切甜食,你刚刚买了一包新鲜的 $N$ 颗氧气果冻豆。当然,普通的果冻豆是不在考虑范围内的。作为你体验生活中一切事物的愿望的一部分,你购买了特殊的氧气果冻豆,这是一种稀有且独家的糖果。

现在到了吃糖的时候,你决定用数学的方法来解决吃氧气果冻豆的问题。

假设你想在接下来的 $M$($1 \le M \le N$)天内吃掉 $N$ 颗氧气果冻豆,每天吃掉相同数量的氧气果冻豆。然而,如果 $M$ 不能整除 $N$,这可能是无法实现的。在这种情况下,你希望每天吃掉 $\lfloor N/M \rfloor$ 颗氧气果冻豆。剩余的 $N \bmod M$ 颗氧气果冻豆应该被分成 $M$ 个相等的较小部分。如果这是可行的,你每天将恰好吃掉其中的一部分。

你共有多少种可能的 $M$ 的选择?

输入格式

输入文件仅包含一行,一个整数 $N$($1 \le N \le 10^{12}$)。

输出格式

输出可能的 $M$ 的值的数量。

样例

输入样例 1

5

输出样例 1

4

说明

样例中 $M$ 的可能取值为:

  • 1(在唯一的一天吃掉所有糖果);
  • 2(将一颗糖果平分成两份,每天吃掉两颗完整的糖果和其中一份);
  • 4(将一颗糖果平分成四份,每天吃掉一颗完整的糖果和其中一份);
  • 5(每天吃一颗糖果)。

注意 $M$ 不能等于 3,因为你无法将 $N \bmod M = 2$ 颗糖果平分成 $M = 3$ 个相等的部分。

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.