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: 112ms
Memory: 24436kB
Author: zby
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

t=int(input())

for x in range(t):   
    n,m,k=list(map(int,input().split()))
    a=[]
    for row in range(n):
        b=list(map(int,input().split()))
        a.append(b)

    for i in range(k):
        a=tran(a)
        
    for i in a:
        for j in i:
              print(j,end=" ")
        print("")
    print(' ')