|
||||||||||
Matrix RotationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 753 Accepted Submission(s): 276 Problem Description 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). Input 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. Output 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. Sample Input
Sample Output
Author WhereIsHeroFrom Source | ||||||||||
|