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

#include<stdio.h>
#include<stdlib.h>
int main(){
	int t,n,m,k,i,j,x;
	int ans[102][102];
	scanf("%d",&t);
	x=t;
	while(t--){
		if(t!=x-1){
			printf("\n");
		}
		scanf("%d %d %d",&n,&m,&k);
		for(i=0;i<n;i++){
			for(j=0;j<m;j++){
				scanf("%d",&ans[i][j]);
			}
		}
		if(k%4==1){
			for(j=0;j<m;j++){
				for(i=0;i<n;i++){
					printf("%d ",ans[n-1-i][j]);
				}
				printf("\n");
			}
		}
		if(k%4==2){
			for(i=0;i<n;i++){
				for(j=0;j<m;j++){
					printf("%d ",ans[n-1-i][m-1-j]);
				}
				printf("\n");
			}
		}
		if(k%4==3){
			for(j=0;j<m;j++){
				for(i=0;i<n;i++){
					printf("%d ",ans[i][m-1-j]);
				}
				printf("\n");
			}
		}
		if(k%4==0){
			for(i=0;i<n;i++){
				for(j=0;j<m;j++){
					printf("%d ",ans[i][j]);
				}
				printf("\n");
			}
		}
	}
}