#include "bits/stdc++.h"
using namespace std;
#define intt long long
#define fi first
#define se second
const intt mxN = 2e5 + 5;
const intt LG = 20;
const intt inf = 1e18;
intt n;
void _() {
cin >> n;
if(n % 2 != 0) {
for(intt i = 1; i <= n; i++) {
for(intt j = 1; j <= n; j++) {
cout << (i - 1) * n + j << " ";
}
cout << endl;
}
} else {
cout << -1 << endl;
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
intt t = 1, buu = 1;
// cin >> t;
while(t--){
// cout << "Case #" << buu++ << ": ";
_();
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |