Start: Apr, 17, 2017 10:00:00
Python程序设计基础培训第三次作业
End: Apr, 23, 2017 14:00:00
Time elapsed:
Time remaining:

Problem_ID: D
Result: Accepted
Time: 140ms
Memory: 21432kB
Author: 13185217161
In contest: 1087

a=int(input())
for i in range(a):
	row,col,k=map(int,raw_input().strip().split())
	l=[[0 for i in range(col)] for i in range(row)]
	for j in range(row):
		l[j]=map(int,raw_input().strip().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],
		print
	print