Advertisement
STANAANDREY

bacT16 SIII 2

May 18th, 2021
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. #define NMAX (int)1e4 + 3
  4. int n, m, arr[NMAX][NMAX];
  5.  
  6. int main() {
  7. int n, m;
  8. cin >> n >> m;
  9. int nr = n * m * 2 - 1;
  10. for (int i = 1; i <= n; i++) {
  11. for (int j = 1; j <= m; j++) {
  12. arr[i][j] = nr * nr;
  13. nr -= 2;
  14. }
  15. }
  16. for (int i = 1; i <= n; i++) {
  17. for (int j = 1; j <= m; j++) {
  18. cout << arr[i][j] << ' ';
  19. }
  20. cout << '\n';
  21. }
  22. return 0;
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement