QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 2048 MB Points totaux : 100

#2944. 运输意大利面

Statistiques

意大利东北部威尼斯的独特地理位置,由于运河等原因,经常带来运输问题。为了将大量的意大利面从米兰运往威尼斯,一家公司使用载重量为 $A$ 吨的卡车将货物从米兰运往距离威尼斯最近的内陆城市梅斯特,并使用载重量为 $B$ 吨的船只将货物从梅斯特运往威尼斯。某一天,威尼斯的仓库要求运送任意数量的意大利面,但总量不得少于 $C$ 吨,而梅斯特的仓库要求正好运送 $D$ 吨。编写一个程序,确定从米兰出发所需的最少卡车数量,以同时满足这两个订单,并确保运输过程中使用的每一辆卡车和每一艘船都满载。

输入格式

输入包含一行,包含四个整数 $A, B, C$ 和 $D$。其中 $(0 < A \le 100), (0 < B \le 20), (0 \le C \le 100), (0 \le D \le 100)$。

输出格式

输出一行,格式为:We need t trucks and b boats.,其中 $t$ 是所需的卡车数量,$b$ 是所需的船只数量。如果 $t$ 或 $b$ 为 1,则不要将单词 “truck” 或 “boat” 复数化。如果不存在满足条件的解,则输出:No solution.

样例

样例输入 1

31 13 50 28

样例输出 1

We need 3 trucks and 5 boats.

样例输入 2

100 20 30 10

样例输出 2

No solution.

样例输入 3

1 1 1 100

样例输出 3

We need 101 trucks and 1 boat.

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.