#C3125. Custom Diagonal Array
Custom Diagonal Array
Custom Diagonal Array
Given two integers \(N\) and \(M\), your task is to construct an \(N \times M\) matrix where the main diagonal elements (i.e. for \(i = 0, 1, \dots, \min(N, M)-1\)) are set to 9, and every other element is 0.
This problem tests your ability to handle basic matrix construction and indexing. Please ensure that your output format exactly matches the format described below.
inputFormat
The input consists of a single line containing two space-separated integers \(N\) and \(M\), which represent the number of rows and columns of the matrix, respectively.
outputFormat
Output the constructed \(N \times M\) matrix. Each row should be printed on a new line, and the elements on each row should be separated by a single space.
## sample3 3
9 0 0
0 9 0
0 0 9
</p>