#55674: c++ 土法煉鋼


61247091s@gapps.ntnu.edu.tw (wei)


#include <bits/stdc++.h>
using namespace std;

int a[1005][1005];

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int r,c;

    cin>>c>>r;
    for(int i=0;i<r;i++){
        for(int j=0;j<c;j++)cin>>a[i][j];
    }
    for(int i=0;i<r;i++){
        for(int j=0;j<c;j++)cout<<a[i][j]<<" ";
        for(int j=c-1;j>=0;j--)cout<<a[i][j]<<" ";
        cout<<endl;
    }
    for(int i=r-1;i>=0;i--){
        for(int j=0;j<c;j++)cout<<a[i][j]<<" ";
        for(int j=c-1;j>=0;j--)cout<<a[i][j]<<" ";
        cout<<endl;
    }
   
    return 0;
}