Given a matrix Z whose dimensions are multiples of k, partition it into non-overlapping k×k blocks and return the matrix of block sums (shape (Z.shape[0] // k, Z.shape[1] // k)).
Z
k
k×k
(Z.shape[0] // k, Z.shape[1] // k)
solve(...)