QOJ.ac

QOJ

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

#9707. 工厂

Statistiques

你拥有一家生产 $N$ 种饮料的特殊工厂。

工厂里有 $K$ 台机器,每台机器都能生产全部 $N$ 种饮料。所有 $K$ 台机器可以并行工作。一台机器在同一时间只能生产一种饮料,但机器可以在不同饮料的生产之间立即切换。

每台机器的生产能力各不相同。具体来说,第 $j$ 台机器生产 $r$ 升第 $i$ 种饮料需要 $r \times t_{ij}$ 分钟。饮料是连续生产的,因此 $r$ 可以是任意实数。

今天,你接到了一份订单,要求每种饮料各生产 1 升。你希望尽快完成生产。请编写一个程序,计算完成生产所需的最短时间。

输入格式

第一行包含两个正整数 $N, K$ ($N\leq 2\times 10^4, K\leq 50$),分别表示饮料的种类数和机器数。

接下来的 $N$ 行,每行包含 $K$ 个整数。第 $i$ 行的第 $j$ 个数表示 $t_{ij}$ ($1\leq t_{ij}\leq 50$)。

输出格式

输出一行一个实数,表示生产每种饮料各 1 升所需的最短时间。

如果你的答案与标准答案的相对误差不超过 $10^{-2}$,则视为正确。

样例

样例输入 1

3 3
1 2 3
2 1 3
6 6 3

样例输出 1

2.000000

样例输入 2

5 2
1 7
3 9
4 10
5 11
6 12

样例输出 2

12.687500

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.