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: 102ms
Memory: 24300kB
Author: digy
In contest: 1123

a=int(input())
for i in range(a):
	row,col,k=list(map(int,input().split()))
	l=[[0 for i in range(col)] for i in range(row)]
	for j in range(row):
		l[j]=list(map(int,input().split()))
	lz = l
	for n in range(k):
		lz=[[0 for j in range(len(l))] for j in range(len(l[0]))]
		for i in range(len(lz)):
			for j in range(len(lz[0])):
				lz[i][j]=l[len(lz[0])-j-1][i]
		l=lz
	for i in range(len(lz)):
		for j in range(len(lz[0])):
			print (lz[i][j],end=" ")
		print ("")
	print("")