#P3686. The Windy's

The Windy's

Description

The Windy's is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receives N orders for toys. The manager knows that every order will take different amount of hours in different workshops. More precisely, the i-th order will take Zij hours if the toys are making in the j-th workshop. Moreover, each order's work must be wholly completed in the same workshop. And a workshop can not switch to another order until it has finished the previous one. The switch does not cost any time.

The manager wants to minimize the average of the finishing time of the N orders. Can you help him?

Input

The first line of input is the number of test case. The first line of each test case contains two integers, N and M (1 ≤ N,M ≤ 50).
The next N lines each contain M integers, describing the matrix Zij (1 ≤ Zij ≤ 100,000) There is a blank line before each test case.

Output

For each test case output the answer on a single line. The result should be rounded to six decimal places.

3

3 4 100 100 100 1 99 99 99 1 98 98 98 1

3 4 1 100 100 100 99 1 99 99 98 98 1 98

3 4 1 100 100 100 1 99 99 99 98 1 98 98

2.000000
1.000000
1.333333</p>

Source

POJ Founder Monthly Contest – 2008.08.31

, windy7926778

</p>