Find the submatrix with the smallest mean, 2.0 You're given a n-by-m matrix of integers, where n,m > 3. Your task is to find the 3-by-3 sub-matrix that has the lowest mean, and output this value.

Rules and clarifications:


The integers will be non-negative
Optional input and output format
The output must be accurate up to at least 2 decimal poins (if it's non-integer)
The submatrices can be made up of arbitrary columns and rows


Test cases:

1   0   4   0   1   0
1   0   4   0   1   0
4   3   4   3   4   3
1   0   4   0   1   0

Minimum mean: 0   (We have chosen columns 2,4,6 and rows 1,2,4 (1-indexed)
-----------------------------
4    8    9    7
5   10    1    5
8    5    2    4
8    3    5   10
6    6    3    4

Minimum mean: 4.2222
-----------------------------
1   0   0   0   0
0   2   0   0   0
0   0   3   0   0
0   0   0   4   0
0   0   0   0   5

Minimum mean: 0.11111
-----------------------------
371   565   361   625   879   504   113   104
943   544   157   799   726   832   228   405
743   114   171   506   943   181   823   454
503   410   333   735   554   227   423   662
629   439   191   707    52   751   506   924

Minimum mean: 309.56
Mathematica, 77 50 bytes

±x_:=x~Subsets~{3}
Min[Mean/@Mean/@±#&amp;/@±#]&amp;


 is Mathematica's transposition operator (and is rendered as a superscript T in Mathematica).

This answer first defines a helper operator ± which returns all 3-element subsets of a list, and then evaluates to an unnamed function which uses this operator to solve the problem.

This is done by first computing all 3-element subsets of the matrix's rows. Then for each such subset, we transpose it and compute its 3-element subset of rows. This gives us all possible 3x3 submatrices (although they are transposed). We then compute the mean on all of them and find the overall minimum.