#include<bits/stdc++.h>usingnamespace std;constint N =110;int a[N][N];intmain(){int h,l;
cin >> h >> l;int left =0, right = l -1;int top =0, bottom = h -1;int sum =1;while(left <= right || top <= bottom){for(int i = left; i <= right && top <= bottom; i++)
a[top][i]= sum++;//处理第一行
top++;//行数下移for(int i = top; i <= bottom && left <= right; i++)
a[i][right]= sum++;//处理最右列
right--;//最右列左移一位for(int i = right; i >= left && top <= bottom; i--)
a[bottom][i]= sum++;//处理最底部一行
bottom--;//最低行上移for(int i = bottom; i >= top && left <= right; i--)
a[i][left]= sum++;//处理最左一行
left++;//最左行右移一位}for(int i =0; i < h; i++){for(int j =0; j < l; j++) cout<< a[i][j]<<" ";
cout << endl;}return0;}