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: 5ms
Memory: 1092kB
Author: 2018212212276
In contest: 1273

#include<stdio.h>
int main()
{
	int T;int i,j;
	scanf("%d",&T);
	while(T--)
	{
		int n,m,k;
		int sz[100][100];
		scanf("%d%d%d",&n,&m,&k);
		
		for(i=1;i<=n;i++)
			for(j=1;j<=m;j++)
				scanf("%d",&sz[i][j]);
		if(k%4==1)
		{
			for(i=1;i<=m;i++)
			{
				for(j=1;j<=n;j++)
					printf("%d ",sz[n-j+1][i]);
				printf("\n");
			}
		}
		else if(k%4==2)
		{
			for(i=1;i<=n;i++)
			{
				for(j=1;j<=m;j++)
					printf("%d ",sz[n-i+1][m-j+1]);
				printf("\n");
			}
		}
		else if(k%4==3)
		{
			for(i=1;i<=m;i++)
			{
				for(j=1;j<=n;j++)
					printf("%d ",sz[j][m-i+1]);
				printf("\n");
			}
		}
		else if(k%4==0)
		{
			for(i=1;i<=n;i++)
			{
				for(j=1;j<=m;j++)
					printf("%d ",sz[i][j]);
				printf("\n");
			}
		}
		printf("\n");
	}
	return 0;
}