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

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(raw_input().strip())
for case in range(t):
	n,m,k=map(int,raw_input().strip().split())
	list1=[]
	for i in range(n):
		list1.append(map(int,raw_input().strip().split()))
	for j in range(k):
		list1=tran(list1)
	for i in range(len(list1)):
		for j in range(len(list1[0])):
			print list1[i][j],
		print
	print