Give you a n*n matrix, if you rotate it 90 degrees, we call it 1-Matrix, if you rotate it 180 degrees, we call it 2-Matrix, etc … This is said if you rotate the Matrix 90*k degrees, then we call it k-Matrix. Now, your task is to calculate all the sum of i-Matrix (0<= i<= k).
输入解释
There multiple test cases. Each test case begins with one integer n(1 <= n <= 10), following n lines, each line contains n integers, describe the original matrix, then a single line contains a k (1 <= k <= 10^8)described above. Process to end of file.
输出解释
For each case, output the sum of all the i-Matrix (0<= i<= k) in n lines. Each line there are n integers separated by one space. Note that there is no extra space at the end of each line.