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 must be made up of consecutive rows and columns
Test cases:
35 1 6 26 19 24
3 32 7 21 23 25
31 9 2 22 27 20
8 28 33 17 10 15
30 5 34 12 14 16
4 36 29 13 18 11
Minimum mean: 14
100 65 2 93
3 11 31 89
93 15 95 65
77 96 72 34
Minimum mean: 46.111
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
Minimum mean: 1
4 0 0 5 4
4 5 8 4 1
1 4 9 3 1
0 0 1 3 9
0 3 2 4 8
4 9 5 9 6
1 8 7 2 7
2 1 3 7 9
Minimum mean: 2.2222
This is code-golf so the shortest code in each language wins. I encourage people to post answers in languages that are already used, even if it's not shorter than the first one.