Start: Jun, 26, 2019 08:30:00
2019年度暑期短学期第一天
End: Jun, 26, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: A
Result: Accepted
Time: 143ms
Memory: 21440kB
Author: 2018212212077
In contest: 1273

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