QOJ.ac

QOJ

Time Limit: 2.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓

#14403. 自定义纸币

Statistics

在 Jagan 王国,到目前为止只发行了 1 日元面额的纸币。然而,由于纸币流通量的增加,王国决定彻底更新其纸币系统。新的纸币系统由一个正整数序列 $x = (x_1, x_2, \dots, x_k)$ 表示。这意味着新系统使用 $k$ 种面额分别为 $x_1, x_2, \dots, x_k$ 日元的纸币。你可以在满足以下限制条件的前提下,决定纸币种类的数量 $k$ 及其面额 $x_1, x_2, \dots, x_k$:

  • $k$ 是一个正整数。
  • $1 = x_1 < x_2 < \dots < x_k$。
  • $x_{i+1}$ 必须是 $x_i$ 的倍数($1 \le i \le k - 1$)。

在 Jagan 王国,商品经常以 $a$、$b$ 或 $c$ 日元的价格进行交易。因此,新纸币系统的不便度定义为:

$$ \begin{aligned} & (\text{表示 } a \text{ 日元所需的最少纸币张数}) \ + \\ & (\text{表示 } b \text{ 日元所需的最少纸币张数}) \ + \\ & (\text{表示 } c \text{ 日元所需的最少纸币张数}) \end{aligned} $$

你的任务是求出该不便度的最小可能值。

输入格式

输入的第一行包含三个整数:$a$、$b$ 和 $c$($1 \le a < b < c \le 10^8$)。

输出格式

输出一个整数:新纸币系统不便度的最小可能值。

样例

输入样例 1

6 11 15

输出样例 1

6

输入样例 2

99999959 99999971 99999989

输出样例 2

11

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.