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: 115ms
Memory: 24432kB
Author: ajwuzhicheng
In contest: 1123

def xz(jz):
	res=[]
	for lie in range(len(jz[0])):
		tep=[]
		for hang in range(len(jz)-1,-1,-1):
			tep.append(jz[hang][lie])
		res.append(tep)
	return res
count=int(input())
jzxx=[]
jz=[]
for i in range(count):
	jzxx.append(list(map(int,input().split())))
	for j in range(jzxx[i][0]):
		jz.append(list(map(int,input().split())))
p=-1
for i in range(count):
	tep=[]
	for j in range(jzxx[i][0]):
		p+=1
		tep.append(jz[p])
	for j in range(1,jzxx[i][2]+1):
		tep=xz(tep)
	for j in range(len(tep)):
		for k in range(len(tep[0])):
			print(tep[j][k],end=' ')
		print()
	print()