#K50162. Smallest Number on the Diagonal
Smallest Number on the Diagonal
Smallest Number on the Diagonal
Given a square matrix \( A \) of size \( n \times n \), find the smallest number on its main diagonal. The main diagonal of a matrix consists of the elements \( A[i][i] \) for \( 0 \leq i < n \). Your task is to compute \( \min_{0 \le i < n} A[i][i] \).
For example, if the input matrix is:
3 1 2 3 4 5 6 7 8 9
Then the main diagonal elements are \( 1, 5, 9 \) and the smallest among them is 1.
inputFormat
The first line contains a single integer \( n \) representing the size of the matrix. Each of the next \( n \) lines contains \( n \) space-separated integers representing a row of the matrix.
For example:
3 1 2 3 4 5 6 7 8 9
outputFormat
Output a single integer, which is the smallest number found on the main diagonal of the matrix.
## sample3
1 2 3
4 5 6
7 8 9
1