#P17737. [ICPC 2019 Xuzhou R] Factory
[ICPC 2019 Xuzhou R] Factory
Problem Description
You own a special beverage factory producing kinds of beverages.
There are machines in your factory, and each machine can produce all kinds of beverages. All 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 minutes for the -th machine to produce liters of the -th beverage. Beverages are produced continuously, so the value of can be any real number.
Today, you got an order requesting 1 liter of each of all 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 Format
The first line contains two positive integers () --- the number of beverages and machines.
The next lines contain integers each. The -th number of the -th line contains the number ().
Output Format
Output one real number in a line, representing the minimum time to produce 1 liter of each of all kinds of beverages.
Your answer will be considered correct if the relative error does not exceed .
3 3
1 2 3
2 1 3
6 6 3
2.000000
5 2
1 7
3 9
4 10
5 11
6 12
12.687500