Hard one - Beautiful Matrices:
GIven an m x m matrix, imagine that there are submatrices within the matrix that are n x n, where m % n = 0. (you are given n)
The average value of the submatrix (nxn) is known as it's Beauty number. Sort the matrix from left to right (and back to the beginning and down, repeat) by sorting the submatrices on their beauty numbers.