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: 144ms
Memory: 21432kB
Author: shanzhenyu
In contest: 1087


def tran(li):
	n = len(li);
	m = len(li[0]);
	t =[[0 for col in range(n)] for row in range(m)]
	for i in range(0,m):
		for j in range(0,n):			 
			t[i][j] = li[n-1-j][i]
			#print i,j,t,t[j][m-1-j],li[i][j]
	return t

tcase = int(raw_input().strip())
for case in range(tcase):  
	n,m,k = map(int, raw_input().strip().split())
	li = []
	for i in range(n):
		li.append(map(int, raw_input().strip().split()))
	for j in range(k):
		li = tran(li)
		
	for i in range(len(li)):
		for j in range(len(li[0])):
			print li[i][j],
		print
	print