Question: block matrix from non-square matrix

Hi

I would like to extract the Anew matrix from the old matrix A. such that each row from Anew matrix has a square form of old matrix i.e all number from each row in the Anew form a square in my old matrix A ...

Is there any loop to determie  the Anew matrix in general  case

Such that A new

A := Matrix([[1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [11, 12, 13, 14, 15, 16, 17, 18, 19, 20], [21, 22, 23, 24, 25, 26, 27, 28, 29, 30], [31, 32, 33, 34, 35, 36, 37, 38, 39, 40], [41, 42, 43, 44, 45, 46, 47, 48, 49, 50]])

Anew = Matrix([[2, 13, 22, 11], [4, 15, 24, 13], [6, 17, 26, 15], [8, 19, 28, 17], [13, 24, 33, 22], [15, 26, 35, 24], [17, 28, 37, 26], [19, 30, 39, 28], [24, 35, 44, 33], [26, 37, 46, 35], [28, 39, 48, 37]])

Many thanks

Please Wait...