QOJ.ac

QOJ

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

#14403. 自訂紙鈔

الإحصائيات

在 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$ 日圓的價格進行交易。因此,新紙鈔系統的不便度定義為:

(表示 $a$ 日圓所需的最少紙鈔張數)$+$ (表示 $b$ 日圓所需的最少紙鈔張數)$+$ (表示 $c$ 日圓所需的最少紙鈔張數)。

你的任務是求出該不便度的最小可能值。

輸入格式

輸入的第一行包含三個整數:$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.