Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- #define NMAX (int)1e4 + 3
- int n, m, arr[NMAX][NMAX];
- int main() {
- int n, m;
- cin >> n >> m;
- int nr = n * m * 2 - 1;
- for (int i = 1; i <= n; i++) {
- for (int j = 1; j <= m; j++) {
- arr[i][j] = nr * nr;
- nr -= 2;
- }
- }
- for (int i = 1; i <= n; i++) {
- for (int j = 1; j <= m; j++) {
- cout << arr[i][j] << ' ';
- }
- cout << '\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement