QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 2048 MB Total points: 100

#9707. Factory

الإحصائيات

You own a special beverage factory producing $N$ kinds of beverages.

There are $K$ machines in your factory, and each machine can produce all $N$ kinds of beverages. All $K$ machines can work in parallel. One machine can only produce one kind of beverage at a time, but machines can switch from producing a kind of beverage to another immediately.

Each machine has different production abilities. Specifically, it takes $r\times t_{ij}$ minutes for the $j$-th machine to produce $r$ liters of the $i$-th beverage. Beverages are produced continuously, so the value of $r$ can be any real number.

Today, you got an order requesting 1 liter of each of all $N$ kinds of beverages. You want to finish the production as soon as possible. Thus, please write a program to calculate the minimum possible time to finish the production.

Input

The first line contains two positive integers $N, K$ ($N\leq 2\times 10^4, K\leq 50$) --- the number of beverages and machines.

The next $N$ lines contain $K$ integers each. The $j$-th number of the $i$-th line contains the number $t_{ij}$ ($1\leq t_{ij}\leq 50$).

Output

Output one real number in a line, representing the minimum time to produce 1 liter of each of all $N$ kinds of beverages.

Your answer will be considered correct if the relative error does not exceed $10^{-2}$.

Sample Input 1

3 3
1 2 3
2 1 3
6 6 3

Sample Output 1

2.000000

Sample Input 2

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

Sample Output 2

12.687500
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.