Start: Nov, 12, 2017 10:00:00
2017秋Python程序设计基础培训第三次作业
End: Nov, 19, 2017 12:00:00
Time elapsed:
Time remaining:

Problem_ID: D
Result: Accepted
Time: 103ms
Memory: 24300kB
Author: zzhk
In contest: 1123


def tran(list1):
    n=len(list1)
    m=len(list1[0])
    t=[[0 for i in range(n)] for j in range(m)]
    for i in range(m):
        for j in range(n):
            t[i][j]=list1[n-1-j][i]
    return t
n=int(input())
for i in range(n):
    r,c,k=map(int,input().split())
    list1=[]
    for a in range(r):
        list1.append(list(map(int,input().split())))
    for b in range(k):
        list1=tran(list1)
    for a in range(len(list1)):
        for b in range(len(list1[0])):
            print(list1[a][b],end=' ')
        print()
    print()