#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main() {
    int arr[100][100] = {0};
    int n,m;
    
    scanf("%d %d", &n, &m);

    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            arr[i][j] = (m-j)*n - i;
        }
    }
    
    for(int i=0; i<n; i++){
        for(int j=0; j<m; j++){
            printf("%d ", arr[i][j]);
        }
        printf("\n");
    }
    
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: